Hi,

I need to display date in "month year" format, for example "August 2018".

So I had this minimal reproducible code (excluding package name and import 
statements):

```
func main() {
        target := TargetDate(8)

        fmt.Println("Target month is ", target.Format("January 2009"))
}

// TargetDate returns target date for selected month
func TargetDate(month int) time.Time {
        return time.Date(2018, time.Month(month), 1, 0, 0, 0, 0, time.UTC)
}
```

I expected that the output date for code above was "August 2018",
but what I got was "August 1009". But when I changed the date format string
to "January 2006" (year 2006 as on the reference time mentioned in
documentation for `time`), I got the expected result.

Was above a bug?

--
An old man doll... just what I always wanted! - Clara

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7f0aa08a-9428-d958-bdb3-5d2796afedab%40gmail.com.

Reply via email to