-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Resolve #7860 - add time.RFC3339 format #7980
Resolve #7860 - add time.RFC3339 format #7980
Conversation
Fixes: #7860 |
Thanks @3sky |
The given example string in #7860 was "Created": "2020-09-27T17:01:55.178157437", which is actually RFC3339Nano in Go |
@@ -316,7 +317,7 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON, | |||
|
|||
cb := types.ContainerJSONBase{ | |||
ID: l.ID(), | |||
Created: l.CreatedTime().String(), | |||
Created: l.CreatedTime().Format(time.RFC3339), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this should be RFC3339Nano instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch @mheon , I'd to double check, that's what Docker displayes to their logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mheon! I expected that regular ISO_8601 format can be used. However changed to:
l.CreatedTime().Format(time.RFC3339Nano),
Now output is:
"2020-10-12T08:48:53.855528237+02:00"
bd75d89
to
b3223de
Compare
Signed-off-by: 3sky <[email protected]>
b3223de
to
1fc64c8
Compare
maybe need to add a test? |
@zhangguanzhang something like this tests here |
yes |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3sky, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I can't find any other usage of this type, also no unit-tests for that. Sample validation below:
Signed-off-by: 3sky [email protected]