Block that convert a date and time value in EPOCH format to an easy-to-read format.
Ladder Representation

Block Structure
Variable Type |
Name |
Data Type |
Description |
VAR_INPUT |
EN |
BOOL |
Block enabling |
Epoch |
DWORD |
Time in EPOCH format |
|
VAR_OUTPUT |
Second |
BYTE |
Seconds |
Minute |
BYTE |
Minutes |
|
Hour |
BYTE |
Hours |
|
Day |
BYTE |
Days |
|
Month |
BYTE |
Months |
|
Year |
WORD |
Years |
|
WeekDay |
BYTE |
Day of the week |
|
ENO |
BOOL |
End of operation |
Operation
When this block has the TRUE value in EN, it interprets the date and time value in EPOCH format and converts it to values that are easy to interpret.
When EN has a FALSE value, outputs remain unchanged.
The ENO value forwards to the next Ladder block the EN value after the operation is completed.
Example in Ladder

The example above converts date and time in EPOCH format (DWORD) to easy-to-read values. The block ends with success, and the ENO output is activated.
Example in ST
The example below displays instructions for applying the example above in ST language.
VAR enable : BOOL := 1; done : BOOL; sec : BYTE; min : BYTE; hour : BYTE; day : BYTE; month : BYTE; year : WORD; wDay : BYTE; epoch : DWORD := 1717200000; END_VAR
done := FB_EPOCH_TO_DATETIME(EN:=enable, Epoch:= epoch, Second=> sec, Minute=>min, Hour=>hour, Day=>day, Month=>month, Year=>year, WeekDay=>wDay);
|
|---|