omron — $TIME string function

$TIME string function $TIME string function Syntax $TIME ( date, time ) Function Return a string value containing either the current system date and time or the specified date and time. Parameters date Optional integer value representing the year, month, and day (see below). The value is interpreted as follows (month ranges from 1 to 12): date = (year-1980)*512 + month*32 + day time Optional integer value representing the hour, minutes, and seconds past midnight (see below). The value is interpreted as follows (hour ranges from 0 to 23): time = hour*2048 + minute*32 + second/2 NOTE: This function always returns a string containing both the date and the time.

That can result in an erroneous date string if the date parameter is omitted when the time parameter is specified. Details If both the date and time parameters are omitted, this function returns the current system date and time in the format described below. (An empty string is returned if the system clock has not been initialized.) If the date and time parameters are specified, their values are converted to an ASCII string in the format described below, and the string is returned. This operation is used to decode the output values generated by the TIME real-valued function.

The date and time are output in the format dd-mmm-yy hh:mm:ss, in which the individual elements are defined as follows: eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 532 Element Description dd The day of the month (1 to 31) mmm The month, specified as a 3-letter abbreviation (JAN, FEB, MAR, APR,