Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
how to format datetime in http/template?
9,778 views
Skip to first unread message
John Qin
unread,
Jun 3, 2014, 9:55:59 PM
6/3/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
here's the code. i try to format the date to following two formats.
{{.CreatedOn.Format "2014-01-02"}} <br/>
{{.CreatedOn.Format "Wednesday, October 16, 2013"}}
I am getting this weird date back.
30655-06-03
WEDNESDAY, OCTOBER 66, 3068
Jesse McNelis
unread,
Jun 3, 2014, 10:10:14 PM
6/3/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to John Qin, golang-nuts
Read the time pkg docs for the correct format of the time format string.
http://golang.org/pkg/time/#pkg-constants
John Qin
unread,
Jun 3, 2014, 10:27:13 PM
6/3/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com, myw...@gmail.com, jes...@jessta.id.au
thank you so much. I didnt realize I have to use the year , date, month listed on their page. now its working.
Reply all
Reply to author
Forward
0 new messages