From 42b38b8ba8f1f340dc9fb7cb5a62d3e7da1e60b4 Mon Sep 17 00:00:00 2001 From: Ruth <70951501+b00lqa@users.noreply.github.com> Date: Sat, 1 Jul 2023 12:51:06 +0300 Subject: [PATCH] Add explanation of time layout Thought it would be useful for new gophers to see what is the meaning behind this special date --- concepts/time/about.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/concepts/time/about.md b/concepts/time/about.md index 57628ff07..963779fe3 100644 --- a/concepts/time/about.md +++ b/concepts/time/about.md @@ -5,6 +5,18 @@ A [`Time`][time] in Go is a type describing a moment in time. The date and time The [`time.Parse`][parse] function parses strings into values of type `Time`. Go has a special way of how you define the layout you expect for the parsing. You need to write an example of the layout using the values from this special timestamp: `Mon Jan 2 15:04:05 -0700 MST 2006`. +This timestamp is a simple increasing sequence: 01 02 03 04 05 (PM) 06 07: + +| Value | Meaning | +| ----- | ------------------------ | +| 01 | `Jan` is 1 month | +| 02 | Day | +| 03 | Hours in 12-hour system | +| 04 | Minutes | +| 05 | Seconds | +| 06 | Year | +| 07 | `MST` meand `UTC+7` | + For example: ```go