Skip to content

Commit

Permalink
fix(localtime): Follow RFC3339 date format
Browse files Browse the repository at this point in the history
RFC3339 specifies a `T` between date and time, not a space[1].

[1]: https://pkg.go.dev/time#pkg-constants

Resolves: part of pelletier#613
  • Loading branch information
jidicula committed Oct 17, 2021
1 parent 6692dbc commit 398673e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion localtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (d LocalDateTime) AsTime(zone *time.Location) time.Time {

// String returns RFC 3339 representation of d.
func (d LocalDateTime) String() string {
return d.LocalDate.String() + " " + d.LocalTime.String()
return d.LocalDate.String() + "T" + d.LocalTime.String()
}

// MarshalText returns RFC 3339 representation of d.
Expand Down

0 comments on commit 398673e

Please sign in to comment.