-
Notifications
You must be signed in to change notification settings - Fork 18k
time: add ISO 8601 format #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
go for it Owner changed to r...@golang.org. Status changed to Accepted. |
see attached file for what i've been working with; in the style found in src/pkg/time.go the attached function could be: func (t *Time) ISO8601() string { var tz string; if t.Zone == "UTC" { tz = "Z"; } else { tz = fmt.Sprintf("%03d00", t.ZoneOffset / 3600 ) } return fmt.Sprintf("%04d-%02d-%02dT%02d:%02d:%02d%s", t.Year, t.Month, t.Day, t.Hour, t.Minute, t.Second, tz); } note that this uses fmt, not the stripped down format function found in time.go Attachments:
|
This issue was closed by revision d2a835f. Status changed to Fixed. Merged into issue #-. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by sionide21:
The text was updated successfully, but these errors were encountered: