From OpenSCADAWiki
Jump to: navigation, search

Time: String to time (tmStrPTime)

Description: Converting the string data and time, for the form, to the time in seconds since 01.01.1970. For example, template "%Y-%m-%d %H:%M:%S" corresponds the time "2006-08-08 11:21:55". Description of the format of the template can be obtained from the documentation on the POSIX-function "strptime()".
Parameters:

Identifier Parameter Type Mode By defaults
sec Seconds Integer Return 0
str Date and time string String Input
form Date and time format String Input  %Y-%m-%d %H:%M:%S

Example:

using Special.FLibSYS;
curMin=curHour=curDay=curMonth=curYear=0;
tmDate(tmTime(),0,curMin,curHour,curDay,curMonth,curYear);
test = tmStrPTime(""+curYear+"-"+(curMonth+1)+"-"+curDay+" 9:0:0","%Y-%m-%d %H:%M:%S");
messPut("Example",0,"tmStrPTime(): "+test);