1.parse date-and-time node(lyd_parse_op)(2023-06-02T20:13:25Z);2. print this node(lyd_print_mem), the value change to 2023-06-03T04:13:25+08:00. Is there some method to refuse this change? #2062
Unanswered
jiayinhaoran
asked this question in
Q&A
Replies: 1 comment
-
YANG |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
parse date-and-time node(lyd_parse_op)(2023-06-02T20:13:25Z);
{"xxx:date-time":"2023-06-02T20:13:25Z"}
use these interfaces:
ly_in_new_memory
lyd_parse_op
print this node(lyd_print_mem), the value change to 2023-06-03T04:13:25+08:00
use these interface:
lyd_print_mem
the result is: {"xxx:date-time":"2023-06-03T04:13:25+08:00"}
Why GMT time is automatically changed to local time?
I find that 'lyplg_type_print_date_and_time' will print data-and-time type node value, and it look like do a forced conversion.
I also read this link: #2045
But, I think that:
from rfc3339, data-time's time-offset can be "Z" or time-numoffset, why must print with time-numoffset?
Is there some method to refuse this change or how can I print date-and-time with "Z" time?
@michalvasko
Beta Was this translation helpful? Give feedback.
All reactions