VC20MkTime
Passing the reference to a CALENDAR device the VC20MkTime function gives the number of seconds elapsed from 1 January 00:00 of 1970 (Epoch Time) until the date introduced.
This data is useful to be able to make comparisons between dates.
The function also runs day and month values greater than its natural limits (day > 31 or month > 12), automatically calculating the date.
IMPLEMENTATION
VC20MkTime (calendar, errorCode, seconds, dayOfWeek, dayOfYear )
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | CALENDAR | calendar (INTDEVICE) | - | Reference to a CALENDAR device |
OUT | GLOBAL | errorCode | B | Error code: 0 = No 1 = Day ≤ 0 2 = Month ≤ 0 3 = Year introduced off limits [1970÷2037] |
OUT | GLOBAL | seconds | L | Sum of elapsed seconds from 00:00 of 1 January 1970 until date introduced |
OUT | GLOBAL | dayOfWeek | B | Day of the week: 0 = sunday 1 = monday 2 = tuesday 3 = wednesday 4 = thursday 5 = friday 6 = saturday |
OUT | GLOBAL | dayOfYear | W | Number of days gone by than the 1 January of the introduced year |
Example
To enable a digital output (ofUscita01) when the date and current time exceeds a previously set date and time.