Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have this datetime, or something that looks like it.

2014-11-17 23:02:03 +0000 UTC

I want to convert this to a time object and I've been unable to produce any output from time.Parse apart from:

0001-01-01 00:00:00 +0000 UTC

I've tried these layouts:

time.RFC3339
0001-01-01 00:00:00 0000 UTC
2016-10-10
time.UnixDate

And a few more - none have worked.

This is how I'm calling parse :

updatedAt, err := time.Parse(time.UnixDate, updatedAtVar)

How do I create a time object from a string?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
980 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...