day_time

 Function - Format the present date / time to a string.

Inputs

Input

Data Type

Range

Unit

Default

Description

SEL

DINT

0 to 2

N/A

No default

Format string.

Outputs

Output

Data Type

Range

Unit

Description

Q

STRING

No range

N/A

String containing formatted date or time.

Remarks


  • PCMM generation 1 controllers do not have real-time clock hardware.
    PCMM2G does have re-time clock hardware.
    Real-time clock may not be available on all controller hardware models.
    See the controller hardware specifications for real-time clock availability.

Valid values of the SEL input are:

Value Description

0 (default)

Current date - format: YYYY/MM/DD.

1

Current time - format: HH:MM:SS.

2

Day of the week.

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the operation is executed only if the input rung (EN) is TRUE.
    • The output rung (ENO) keeps the same value as the input rung.

IL Language Example

Op1: LD SEL
DAY_TIME
ST Q

ST Language Example

Q := DAY_TIME (SEL);

See Also

DTFormat