DATETIMESTRING
Convert a time and date (stored as a double) to a chain of characters.
WebVue support - Yes.
This instruction will not work with values equivalent to dates earlier than 01/01/1980. The starting time is 00:00:00.000 on that date.
Syntax
StrVal = DATETIMESTRING(TimeDate [, Format]);
Return type: STR.
Argument |
Meaning |
TimeDate |
A time and date represented by the number of milliseconds since 1980. Type DOUBLE. |
Format |
A chain of characters representing the format of the string. |
U | UTC format (equivalent to ###Y-#M-#DT#h:#m:#s:##lZ) |
#D |
Day |
#M |
Month |
#Y |
Year as two characters (example 93) |
###Y |
Year as four characters (example 1994) |
#h |
Hours |
#m |
Minutes |
#s |
Seconds |
##l |
Milliseconds |
D |
Use the format #D/#M/#Y |
T |
Use the format #h:#m:#s |
(null) |
Use a default of #D/#M/#Y #h:#m:#s |
Execution
The time and/or date is/are returned as a string in the specified format.
Example
SUB Main
'Declare variables
DIM dbldatetime as double;
DIM strformatdefault as Str;
dbldatetime = DATETIMEVALUE ( );
'Retrieve the current date & time
strformatdefault=DATETIMESTRING(dbldatetime,"D");
END SUB