Skip to content

Fix RFC3339 typo in docs#3975

Merged
vvoland merged 2 commits intodocker:masterfrom
IJMacD:patch-1
Jun 20, 2024
Merged

Fix RFC3339 typo in docs#3975
vvoland merged 2 commits intodocker:masterfrom
IJMacD:patch-1

Conversation

@IJMacD
Copy link
Copy Markdown
Contributor

@IJMacD IJMacD commented Jan 16, 2023

- What I did
Edited the docs

- How I did it
N/A

- How to verify it
N/A

- Description for the changelog

Fix RFC3339 typo in docs

- A picture of a cute animal (not mandatory but encouraged)

Copy link
Copy Markdown
Collaborator

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
There are also other occurrences of this:

docs/reference/commandline/network_prune.md
47:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

docs/reference/commandline/system_events.md
113:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

docs/reference/commandline/logs.md
50:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

docs/reference/commandline/service_logs.md
66:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

docs/reference/commandline/events.md
151:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

docs/reference/commandline/image_prune.md
72:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

docs/reference/commandline/container_prune.md
49:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

man/src/system/events.md
27:`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local

Would you be interested in correcting them as well?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.73%. Comparing base (1583484) to head (64c20f3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3975      +/-   ##
==========================================
- Coverage   61.76%   61.73%   -0.03%     
==========================================
  Files         297      294       -3     
  Lines       20768    20763       -5     
==========================================
- Hits        12828    12819       -9     
- Misses       7024     7026       +2     
- Partials      916      918       +2     

@thaJeztah
Copy link
Copy Markdown
Member

I was wondering of some of this was intentional (but admitted; I always get confused on Go's time format strings); also because Z is described further down, and looking at https://github.com/moby/moby/blob/17b2c89116a3fa9ebfe24b38000365096dc8bdc2/api/types/time/timestamp.go#L11-L18

// These are additional predefined layouts for use in Time.Format and Time.Parse
// with --since and --until parameters for `docker logs` and `docker events`
const (
	rFC3339Local     = "2006-01-02T15:04:05"           // RFC3339 with local timezone
	rFC3339NanoLocal = "2006-01-02T15:04:05.999999999" // RFC3339Nano with local timezone
	dateWithZone     = "2006-01-02Z07:00"              // RFC3339 with time at 00:00:00
	dateLocal        = "2006-01-02"                    // RFC3339 with local timezone and time at 00:00:00
)

@vvoland
Copy link
Copy Markdown
Collaborator

vvoland commented Jan 18, 2023

Yeah I looked into it, it's a bit misleading because 2006-01-02Z07:00 is expected to parse dates with timezone, but without time. So:
time.Parse("2006-01-02Z07:00", "2023-01-18Z16:02") = error
time.Parse("2006-01-02Z07:00", "2023-01-18+03:00") = ok, 2023-01-18, time 00:00, offset +3h

@IJMacD
Copy link
Copy Markdown
Contributor Author

IJMacD commented Jan 31, 2023

@vvoland I have pushed changes to the other files you mentioned.

I agree that Go's time format specifiers and accompanying documentation in incredibly misleading and leads to slip ups like this propagating across the ecosystem.

2006-01-02Z07:00 is valid as a format specifier in Go; it is never a valid value.

The change in this pull request is the minimal diff to get valid ISO 8601 values in the Docker docs i.e. 2006-01-02T07:00 changing Z to T to make a combined date-time representation (at 7 am local time)

I can't be sure but the Go docs seem to suggest the format specifier 2006-01-02Z07:00 would accept the following values implying 00:00:00 in UTC or local time. However, neither of the following is valid under ISO 8601 [1].

{ 2006-01-02Z, 2006-01-02+07:00 }

[Ref 1: ISO 8601-1:2019 § 5.4.2.1]

Copy link
Copy Markdown
Collaborator

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thaJeztah thaJeztah modified the milestones: 23.0.0, 23.0.1 Feb 2, 2023
@thaJeztah thaJeztah modified the milestones: 23.0.1, v-next Feb 9, 2023
@thaJeztah thaJeztah modified the milestones: 24.0.0, 25.0.0 May 5, 2023
@thaJeztah thaJeztah modified the milestones: 25.0.0, 26.0.0 Jan 19, 2024
@vvoland vvoland modified the milestones: 26.0.0, 27.0.0 Mar 14, 2024
IJMacD and others added 2 commits June 20, 2024 12:18
Signed-off-by: Iain MacDonald <ijmacd@gmail.com>
Signed-off-by: Iain MacDonald <ijmacd@gmail.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland requested a review from a team as a code owner June 20, 2024 10:20
@vvoland
Copy link
Copy Markdown
Collaborator

vvoland commented Jun 20, 2024

Sorry for the delay; rebased so we can get this in. Thanks!

@vvoland vvoland merged commit aebdf50 into docker:master Jun 20, 2024
@IJMacD IJMacD deleted the patch-1 branch July 23, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants