Opened 21 hours ago

Last modified 8 hours ago

#4029 new Bug

_Date_Time_SystemTimeToDateTimeStr() wrong output — at Initial Version

Reported by: jchd18 Owned by:
Milestone: Component: Standard UDFs
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

The function _Date_Time_SystemTimeToDateTimeStr() has two related but distinct bugs.

Note: the timestamp returned by _Date_Time_GetSystemTime() is raw UTC.

Local $tST = _Date_Time_GetSystemTime()
ConsoleWrite(_Date_Time_SystemTimeToDateTimeStr($tST, 1, 0) & @LF)
ConsoleWrite(_Date_Time_SystemTimeToDateTimeStr($tST, 1, 1) & @LF)

produces the same output:

2024/09/26 12:23:46
2024/09/26 12:23:46

but the first should be shifted by timezone and DST settings. (I'm in France and currently UTC+02:00.)

Local $tST = _Date_Time_GetSystemTime()
ConsoleWrite(_Date_Time_SystemTimeToDateTimeStr($tST, 3, 0) & @LF)
ConsoleWrite(_Date_Time_SystemTimeToDateTimeStr($tST, 3, 1) & @LF)

produces a very wrong output:

2024-09-26T12:30:29-02:00
2024-09-26T12:30:29Z

The first line has YMDhms wrong by 2 hours and timeshift should read "+02:00", hence the first line should be showing locval time thusly:

2024-09-26T14:30:29+02:00

The second output correctly displays the UTC time.
The help file is ambiguous and even wrong on the role of parameter $iType.

Change History (0)

Note: See TracTickets for help on using tickets.