8: TSP command reference Model DMM7510 7½ Digit Graphical Sampling Multimeter
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
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; must be more than 1970
Hour in 24-hour time format (0 to 23)
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
and verifies the time.
Output:
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
localnode.gettime() (on page 8-221)