Origin of “Mon Jan 2 15:04:05 MST 2006” in golang

前端 未结 2 522
时光说笑
时光说笑 2021-02-01 15:31

In golang documentation, it is stated that :

These are predefined layouts for use in Time.Format and Time.Parse. The reference time used in the layouts

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 16:16

    That's explained immediately after the section you quoted:

    Since MST is GMT-0700, the reference time can be thought of as

    01/02 03:04:05PM '06 -0700

    It's a simple increasing sequence: 01 02 03 04 05 (PM) 06 07.

    Using 03:04 PM rather than 03:04 AM makes it possible to show the two time representations 15:04 and 03:04PM more clearly (this is speculation on my part).

提交回复
热议问题