<@TSTOSECS TS=timestamp
[FORMAT=format]>
<@SECSTOTS SECS=seconds [FORMAT=format]
[ENCODING=encoding]>
<@TSTOSECS> checks the entered timestamp and converts it into seconds, using as a reference, midnight (00:00:00) January 1, 1970 (1970-01-01). Conversely, <@SECSTOTS> converts the entered seconds to a timestamp.
These tags support dates in the range 1970-2037.
All formats assume the Gregorian calendar. All years must be greater than zero. <@TSTOSECS> handles ODBC, ISO, and some numeric formats.
If the date is entered incorrectly--wrong separators or a nonexistent number of hours, minutes or seconds--the tag returns "Invalid day!" If the time is entered incorrectly (wrong separators or a nonexistent number of hours, minutes or seconds) the tag returns "Invalid time!".
The time attribute is mandatory. If no attribute is found while the expression is parsed, the tag returns "No attribute!".
If the optional FORMAT attribute is not used, the value in the configuration variable timestampFormat is used as the output format of this tag.
<@TSTOSECS TS="2000-01-01 12:00:00">
This example returns "946728000".
This example returns "1970-01-01 00:00:05", assuming the default configuration variables correspond to the example's format.
<@DATETOSECS>,
<@SECSTODATE>
Encoding Attribute
<@FORMAT>
Format Attribute
<@ISDATE>, <@ISTIME>,
<@ISTIMESTAMP>
<@TIMETOSECS>, <@SECSTOTIME>
dateFormat, timeFormat, timestampFormat
<@TIMETOSECS>, <@SECSTOTIME>
Copyright © 1999, Pervasive Software. All rights reserved.