Hello,
this is by the way my first go at Go, so bear with me if I ask a lot of obvious seeming questions these days
I have in my old WordPress blog an widget area with a text like “He is at this location for x days now” and calculated that with PHP. Which is easy
How would the equivalent work in Go? I tried the following:
{{ start := "2005-01-08"}}
{{ $ageDays := div (sub now.Unix .start.Unix) 86400 }}
{{ with $ageDays }}{{.}}{{ end }}
which of course fails. How do I transform string value in start to a unix value so that the calculation works?
I know that I could just use the integer unixtime of 8 in the morning of Jan 8th 2005, but I’d like to learn playing with time in (Hu)Go along the way.
Thanks
Patrick