DateTime
Namespace: TcLogLib
Declaration
{attribute: 'hide_all_locals'}
FUNCTION_BLOCK DateTime
Generate time data in different formats.
Properties
AsLocalFileTime
Declaration
{attribute 'monitoring':='variable'}
PROPERTY AsLocalFileTime : Tc2_Utilities.T_FILETIME
Returns local time as Tc2_Utilities.T_FILETIME.
AsLocalSystemTime
Declaration
{attribute 'monitoring':='variable'}
PROPERTY AsLocalSystemTime : Tc2_Utilities.TIMESTRUCT
Returns local time as Tc2_Utilities.TIMESTRUCT.
AsLocalSystemTimeString
Declaration
{attribute 'monitoring':='variable'}
PROPERTY AsLocalSystemTimeString : Tc2_System.T_MAXSTRING
Returns local time as string.
AsUtcFileTime
Declaration
{attribute 'monitoring':='variable'}
PROPERTY AsUtcFileTime : Tc2_Utilities.T_FILETIME
Returns UTC time as Tc2_Utilities.T_FILETIME.
Done
Declaration
{attribute 'monitoring':='call'}
PROPERTY Done : BOOL
When calling DateTime the first time, it takes some time until all time and timezone information is available.
Done is TRUE for one cycle, once all the data is ready.
Methods
ToFormatString
Returns a formatted string containing the actual time information
Y: yearM: monthD: dayh: hourm: minutes: secondi: millisecond
Example:
YYMMDD-hh:mm:ss:iii
=> 20210812-12:30:22:123
Declaration
{attribute 'hide_all_locals'}
METHOD ToFormatString (
format : STRING) : Tc2_System.T_MaxString
Inputs
| Name | Type | Description |
|---|---|---|
| format | STRING | Format the timestamp should have. |