-
Notifications
You must be signed in to change notification settings - Fork 314
Closed
Labels
is:questionIssue is actually a question.Issue is actually a question.
Description
container interfaces {
leaf test {
type yang:date-and-time;
}
}
libyang1:
struct lyd_node *test = lyd_new_leaf(interfaces, NULL, "test", "2023-06-12T19:22:33Z");
lyd_print_mem(&buffer, interfaces, LYD_JSON, LYP_WITHSIBLINGS);
——》
buffer :{"ydb-test-common:interfaces":{"test":"2023-06-12T19:22:33Z"}}
libyang2:
struct lyd_node *test = NULL;
lyd_new_term(interfaces, NULL, "test", "2023-06-12T19:22:33Z", 0, &test);
char *buffer = NULL;
lyd_print_mem(&buffer, interfaces, LYD_JSON, LYD_PRINT_WITHSIBLINGS | LYD_PRINT_SHRINK);
——》
buffer :{"ydb-test-common:interfaces":{"test":"2023-06-13T03:22:33+08:00"}}
"2023-06-13T03:22:33+08:00" is not the value I want. I want "2023-06-12T19:22:33Z".
Metadata
Metadata
Assignees
Labels
is:questionIssue is actually a question.Issue is actually a question.