This function converts the Unix time of data type DInt to a date and time of data type DTL. The timestamp is calculated in UTC. This means that the time zone is not considered.
Only times after 01/01/1990 are permitted.
LGF_UnixTimeToDTL (FC) | ||||||||
---|---|---|---|---|---|---|---|---|
DInt | timeUnix | Ret_Val | DTL | |||||
error | Bool | |||||||
status | Word | |||||||
Identifier | Data type | Description |
---|---|---|
timeUnix | DInt | UNIX time to convert |
Identifier | Data type | Description |
---|---|---|
Ret_Val | DTL | Converted time (Date and time). In case of Error: 0 (error = true) |
error | Bool | FALSE: No error TRUE: An error occurred during the execution of the FB |
status | Word | 16#0000-16#7FFF: Status of the FB 16#8000-16#FFFF: Error identification (see following Table) |
Code / Value | Identifier / Description |
---|---|
16#0000 | STATUS_NO_ERRROR Status: Execution finished without errors |
16#6001 | WARN_CONVERSION_LIMIT Warning: UNIX time (timeUnix) is exactly at the lower limit of 01.01.1990. |
16#8000 | ERR_TIME_BEFORE_1990 Error: UNIX time (timeUnix) is before 01/01/1990. The function does not support this conversion. |
Version & Date | Change description | |
---|---|---|
01.00.00 | Siemens Industry Online Support | |
16.10.2018 | First released version | |
01.00.01 | Simatic Systems Support | |
18.06.2019 | Standard header and block parameters update, status parameter added | |
01.00.02 | Simatic Systems Support | |
10.07.2019 | Commends added and code intention adjusted Add ENO handling | |
03.00.00 | Simatic Systems Support | |
23.04.2020 | Set version to V3.0.0 Harmonize the version of the whole library | |
03.00.01 | Simatic Systems Support | |
23.02.2021 | Insert documentation |