LDT_To_DTL_UTC

 Function - Converts a long date and time (LDT) to a field-expanded calendar date and time (DTL), expressed in Coordinated Universal Time (UTC).

  • No time-zone or daylight-saving adjustment is applied.
  • Use DTL_To_LDT_UTC to perform the reverse conversion.
  • For a local-time conversion, use LDT_To_DTL_Local.

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

input

LDT

N/A

N/A

No default

The timestamp to convert.

output

DTL

N/A

N/A

No default

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

Q

BOOL

FALSE, TRUE

N/A

If TRUE, the conversion completed successfully.

DTL Structure Members

Member

Data Type

Range

Description

Year

UINT

1677 to 2262

The calendar year.

Month

USINT

1 to 12

The calendar month.

Day

USINT

1 to 31

The calendar day of the month.

Hour

USINT

0 to 23

The hour of the day.

Minute

USINT

0 to 59

The minute of the hour.

Second

USINT

0 to 59

The second of the minute.

Nanosecond

UDINT

0 to 999,999,999

The sub-second part, in nanoseconds.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

// Obtain the current time, then convert it to a UTC calendar date and time.
Ok := LDT_Now(MyLDT);
IF Ok THEN
   Ok := LDT_To_DTL_UTC(MyLDT, MyDTL);
   IF Ok THEN
      // MyDTL now holds the current UTC calendar date and time.
   END_IF;
END_IF;