Thanks Marvin! that's exactly what i need
bwt, is there any way to get current timestamp inside the template (without referencing to the data structure) ? something like that: "timestamp: {{time.Now.Unix}}" On Wednesday, December 7, 2016 at 5:47:36 PM UTC+3, Marvin Renich wrote: > > * skrutsko via golang-nuts <golan...@googlegroups.com <javascript:>> > [161207 08:30]: > > Hello > > > > I have a field in my text template: "start":"{{.Start.Format "Jan 02, > 2006 > > 15:04:05 UTC"}}" > > > > But, I want to have output as epoch time. E.g. 148110633400 > > > > Could you please explain how to do this ? Thanks > > Do you mean Unix time (seconds since Jan 1, 1970 UTC)? Try > > "{{.Start.Unix}}" > > Note that in your Format above, UTC should probably be MST to print the > time zone associated with Start. Also, I presume your code has the > double quotes properly escaped for their context, which does not appear > to be done above (though the context is not clear; a more complete > example would be more helpful). > > ...Marvin > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.