Section 8: TSP command reference
Model DMM7510 7½ Digit Graphical Sampling Multimeter Reference Manual
8-226
DMM7510-901-01 Rev. B / May 2015
localnode.settime()
This function sets the date and time of the instrument.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
Yes
Usage
localnode.settime()
localnode.settime(
year
,
month
,
day
,
hour
,
minute
,
second
)
localnode.settime(
hour
,
minute
,
second
)
localnode.settime(os.time({
year
,
month
,
day
}))
localnode.settime(os.time({year =
year
, month =
month
, day =
day
, hour =
hour
, min
=
minute
, sec =
second
}))
year
Year; must be more than 1970
month
Month (1 to 12)
day
Day (1 to 31)
hour
Hour in 24-hour time format (0 to 23)
minute
Minute (0 to 59)
second
Second (0 to 59)
Details
Internally, the instrument bases time in UTC time. UTC time is specified as the number of seconds
since Jan 1, 1970, UTC. You can use UTC time from a local time specification, or you can use UTC
time from another source (for example, your computer).
When called without a parameter (the first form), the function returns the current time.
Example 1
localnode.settime(2014, 3, 31, 14, 25, 0)
print(localnode.settime())
Sets the date and time to Mar 31, 2014 at 2:25 pm
and verifies the time.
Output:
Mon Mar 31 14:25:09 2014
Example 2
systemTime = os.time({year = 2014,
month = 3,
day = 31,
hour = 14,
min = 25})
localnode.settime(systemTime)
print(os.date('%c', gettime()))
Sets the date and time to Mar 31, 2014 at
2:25 pm.
Output:
Wed Mar 31 14:25:00 2010
Also see
(on page 8-221)