From OpenSCADAWiki
Jump to: navigation, search

Time: Date and time (tmDate)

Description: Full date and time in seconds, minutes, hours, etc., based on the absolute time in seconds from the epoch of 1.1.1970.
Parameters:

Identifier Parameter Type Mode By defaults
fullsec Full seconds Integer Input 0
sec Seconds [0...59] Integer Output 0
min Minutes [0...59] Integer Output 0
hour Hours [0...23] Integer Output 0
mday Day of the month [1...31] Integer Output 0
month Month [0...11] Integer Output 0
year Year, from 1900 Integer Output 0
wday Day of the week [0...6] Integer Output 0
yday Day of the year [0...365] Integer Output 0
isdst Daylight saving time Integer Output 0

Example:

using Special.FLibSYS;
curMin=curHour=curDay=curMonth=curYear=0;
tmDate(tmTime(),0,curMin,curHour,curDay,curMonth,curYear);
messPut("test",0,"Current minute: "+curMin);
messPut("test",0,"Current hour: "+curHour);
messPut("test",0,"Current day: "+curDay);
messPut("test",0,"Current month: "+curMonth);
messPut("test",0,"Current Year: "+curYear);