-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UA_print() using UA_DateTime does not use time zone properly #6022
Comments
We already use the better encoding for JSON. This list gives a good overview on sane date formats: |
On the master branch, we we already pretty-print via the JSON encoding. open62541/plugins/ua_log_stdout.c Line 89 in 9aafbdb
|
I have noticed that UA_print has disappeared from the master branch. That‘s one of the reasons why I prefer the 1.3 branch. |
No, it has not disappeared. Right here: open62541/include/open62541/types.h Line 1209 in 9aafbdb
Just we reuse the JSON encoding now also for pretty-printing. |
Description
When printing
UA_DateTime
withUA_Print()
, it prints the time in UTC time zone but indicates the local time zone.This is quite confusing. Usually, the indicated time zone (e.g.
+0200
) is calculated into the printed time, see for example the Linuxdate
command.Background Information / Reproduction Steps
Example code:
Running it prints for example:
The first line (printed by
date
) indicates time zone+02:00
and includes it in the printed time. The printed time is local time.The second line (printed by
UA_print
) indicates time zoneUTC+0200
but does not include it in the printed time. The printed time is UTC, not UTC+0200 as indicated.I suggest to modify
printDateTime()
as follows:Used CMake options:
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: