During PaperMod layouts refactoring I found many non-obvious things for me as PHP developer, like {{ if eq "x" "y" }}, {{ if or $x $y }}, e.t.c. Well, o’k, it strange, but I can accept it, because there is logic in it, but I was not prepared for what I would found – I needed to format a simple date. In PHP, using Twig I would use standard date library and format the way I need it:

{{ post.published_at | date("j F Y H:i") }} {# 14 March 2024 17:32 #}

Same for plain PHP:

echo date_format(date_create('2024-03-14 17:32'), 'j F Y H:i'); // 14 March 2024 17:32 

Now, let’s look at this implementation in Go:

fmt.Println(time.Now().Format("2 January 2006 (Monday) 15:04"))

Firstly I thought it’s a date example Hugo provides. Then I followed the reference to Go official documentation and there I found the same date. Hmm… Okay… Maybe Hugo just reused example from documentation. Let’s investigate StackOverflow:

Only after that I realized, that This real date is part of Go source code! WTF?!! I checked official Go repository and this is what it contains:

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
const (
    Layout      = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order.
    ANSIC       = "Mon Jan _2 15:04:05 2006"
    UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
    RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
    RFC822      = "02 Jan 06 15:04 MST"
    RFC822Z     = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
    RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
    RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
    RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
    RFC3339     = "2006-01-02T15:04:05Z07:00"
    RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
    Kitchen     = "3:04PM"
    // Handy time stamps.
    Stamp      = "Jan _2 15:04:05"
    StampMilli = "Jan _2 15:04:05.000"
    StampMicro = "Jan _2 15:04:05.000000"
    StampNano  = "Jan _2 15:04:05.000000000"
    DateTime   = "2006-01-02 15:04:05"
    DateOnly   = "2006-01-02"
    TimeOnly   = "15:04:05"
)
Language:
Go
Repository path:
src/time/format.go
Commit:
c007ce8

So developers of Go language decided, that this date is more understandable for Go developers than Y-m-d H:i:s? Why? Mnemonics like these, used in PHP, is similar to used by Java, .Net, and many languages, because it is used even in ISO standard as example

Well, You know, Okay, I can understand even this, but why Go developers decided to use exactly 1 2 3:4:5 2006 -7 order? Well, it’s the most funny part: it’s american date format January 2 03:04:05 PM 2006 UTC-7. Ah, yes, the crappiest date format in the world is a language standard. How obvious… I will never understand why americans are constantly trying to force everybody to use what is convenient for them personally, instead of using world standards