• User guide
  • API Reference
Show / Hide Table of Contents
  • TcLogLib
    • Constants
    • Logger
      • Error
      • ErrorCodes
      • LoggingConfiguration
      • LogLevels
      • RollingIntervals
      • ILog
      • ILogCore
      • TcLog
      • TcLogCore
      • TcLogTrig
    • Utils
      • AnyToString
      • DateTime

DateTime

Namespace
TcLogLib

Generate time data in different formats.

FUNCTION_BLOCK DateTime

Properties

AsLocalFileTime

Returns local time as Tc2_Utilities.T_FILETIME.

PROPERTY AsLocalFileTime : Tc2_Utilities.T_FILETIME

Property Value

Tc2_Utilities.T_FILETIME

AsLocalSystemTime

Returns local time as Tc2_Utilities.TIMESTRUCT.

PROPERTY AsLocalSystemTime : Tc2_Utilities.TIMESTRUCT

Property Value

Tc2_Utilities.TIMESTRUCT

AsLocalSystemTimeString

Returns local time as string.

PROPERTY AsLocalSystemTimeString : Tc2_System.T_MAXSTRING

Property Value

Tc2_System.T_MAXSTRING

AsUtcFileTime

Returns UTC time as Tc2_Utilities.T_FILETIME.

PROPERTY AsUtcFileTime : Tc2_Utilities.T_FILETIME

Property Value

Tc2_Utilities.T_FILETIME

Done

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.

PROPERTY Done : BOOL

Property Value

BOOL

Methods

ToFormatString

Returns a formatted string containing the actual time information

  • Y : year
  • M : month
  • D : day
  • h : hour
  • m : minute
  • s : second
  • i : millisecond

Example:
YYMMDD-hh:mm:ss:iii
=> 20210812-12:30:22:123

METHOD ToFormatString (
 format : STRING) : Tc2_System.T_MaxString

Inputs

format STRING

Format the timestamp should have.

Returns

Tc2_System.T_MaxString
  • Edit this page
In this article
Back to top Documentation powered by zkdoc