forked from pothtonswer/discordmuffin
Comments
This commit is contained in:
parent
0c11cae782
commit
a20bdc7fd8
1 changed files with 3 additions and 0 deletions
3
types.go
3
types.go
|
@ -13,8 +13,11 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// A timestamp, in the format YYYY-MM-DDTHH:MM:SS.MSMSMS-TZ:TZ.
|
||||||
type Timestamp string
|
type Timestamp string
|
||||||
|
|
||||||
|
// Parse parses a timestamp string into a time.Time object.
|
||||||
|
// The only time this can fail is if you're parsing an invalid timestamp.
|
||||||
func (t Timestamp) Parse() (time.Time, error) {
|
func (t Timestamp) Parse() (time.Time, error) {
|
||||||
return time.Parse("2006-01-02T15:04:05.000000-07:00", string(t))
|
return time.Parse("2006-01-02T15:04:05.000000-07:00", string(t))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue