Chapter 13 Device Logic (Pawn)
native rM2M_SetDateTime(datetime[TrM2M_DateTime], flags=0);
Sets the system date and time to the values contained in the transferred structure
Parameter
Explanation
datetime
Structure that contains a detailed breakdown of the date and time (see "TrM2M_
DateTime" in chapter "Arrays with symbolic indices" on page 119).
.timestamp = 0:
The values contained in .year, .month, .day, .hour, .minute
and .second are used to set the date/time.
.timestamp != 0:
The time stamp contained in .timestamp is used to set the
date/time.
flags
Configuration flags for setting the system time - OPTIONAL
Bit0 (RM2M_DATETIME_LOCALTIME):
must be set if the transferred
structure contains the time in local
time
Explanation
Return value
l
> 0, difference in seconds between the current time and time to be set
l
0, if the difference between the current time and time to be set is less than
5 sec.
l
ERROR, if invalid parameters were transferred
l
ERROR-1, if the time to be set is more than one day ahead of the current
system time
native rM2M_GetTimezoneOffset();
Returns the difference (in seconds) between the system time (UTC) and local time configured for the
site on the myDatanet server. This can be used to determine the local time in the script by adding the
difference to the system time (UTC). The offset value is determined by the myDatanet server in
accordance with the set time zone (including summer/winter time) and is synchronised during every
connection to the device.
Example: Central European time (CET = UTC+1) is used for the site -> Offset = 3600 sec.
Explanation
Return value
Offset value in seconds
native rM2M_DoW(timestamp);
Calculates the weekday from a given timestamp
Parameter
Explanation
timestamp
Timestamp of the day in question
Explanation
Return value
Weekday, 0=Monday ... 6=Sunday
Rev. 05
121
Summary of Contents for myDatalogEASY V3
Page 2: ......
Page 13: ...Chapter 2 Declaration of conformity Chapter 2 Declaration of conformity Rev 05 13 ...
Page 14: ......
Page 42: ......
Page 76: ......
Page 88: ......
Page 102: ......
Page 110: ......
Page 116: ......
Page 234: ......
Page 244: ......
Page 252: ......
Page 254: ......
Page 266: ......
Page 276: ......