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:
|
|
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