0

How do I make the timestamp format:

2015-01-25T22:22:46+08:00

look like this

2015-01-25T22:22:46.923331Z

To get the first format, I used

time.Now().Format(time.RFC3339)

The second format is the default postgres format that I'm trying to duplicate. Thanks!

1 Answer 1

3

Use "2006-01-02T15:04:05.000000Z" as the format instead. It's just RFC3339 with decimals added.

Sign up to request clarification or add additional context in comments.

2 Comments

still didn't get this part: 923331Z
It didn't? It works for me: play.golang.org/p/CsEZfbnz_b gives 2015-01-25T15:47:58.411372Z

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.