- Function CurrentToString(Format)
CurrentToString
The function CurrentToString
creates a string representation of the
current time in the a specified format.
CurrentToString(
Format ! (input) a string expression
)
Arguments
- Format
A string that holds the date and time format used in the returned string. Valid format strings are described in Format of Time Slots and Periods
Return Value
The result of
CurrentToString
is a description of the current time according to Format.
Example
The code:
_sp_today := CurrentToString("%d-%Am|AllAbbrMonths|-%c%y");
_sp_nowAsReferenceDate := CurrentToString("%c%y-%m-%d %H:%M:%S");
display _sp_today, _sp_nowAsReferenceDate ;
Resulted in:
_sp_today := "09-Jul-2024" ;
_sp_nowAsReferenceDate := "2024-07-09 14:25:50" ;
When this example was created.
Note
There is an option Current_Time_in_LocalDST
that specifies whether
this function takes into account the effects of daylight savings time.
See also
The functions
MomentToString
,CurrentToMoment
.Measure Execution Time
illustrates the use of some time functions. The purpose ofCurrentToString
in that post is to mark the starting point.