Skip to content

time: Formatted output missing leading zero in year #2024

@gjemiller

Description

@gjemiller
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
Compile and run this program:

package main

import "time"

func main() {
    t := time.Time{Year:2001, Month:2, Day:3}
    println(t.Format("06 01 02"))
}


What is the expected output?
01 02 03

What do you see instead?
1 02 03

Which compiler are you using (5g, 6g, 8g, gccgo)?
Goplay on golang.org ( http://goo.gl/VwZh1 )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions