libyang icon indicating copy to clipboard operation
libyang copied to clipboard

YANG always presents the type date-and-time as local time

Open mattiaswal opened this issue 1 year ago • 1 comments

Trying to the see the current date and time represented in original timezone.

Tested using netopeer2-server and netopeer2-cli and the model [email protected]

The server send correctly: 2023-10-18T21:57:21+09:30 but in the CLI the libyang has lost the original timezone information and instead show: 2023-10-18T14:27:21+02:00 (my local timezone)

I expected the data not be transformed from server to client. Is there a reason why it is this way? I can see this transformation is done in the plugin for the type date-and-time in the function ly_time_str2time and ly_time_time2str.

mattiaswal avatar Oct 18 '23 12:10 mattiaswal

Yes, the canonical value is being used.

michalvasko avatar Oct 18 '23 12:10 michalvasko