Skip to content

Instantly share code, notes, and snippets.

@techslides
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save techslides/8758929 to your computer and use it in GitHub Desktop.

Select an option

Save techslides/8758929 to your computer and use it in GitHub Desktop.
Martini Render FuncMap Function to Convert Unix timestamp into nice Date format to be used in a template file
m.Use(render.Renderer(render.Options{
Funcs: []template.FuncMap{
{
"formatTime": func(args ...interface{}) string {
t1 := time.Unix(args[0].(int64), 0)
return t1.Format(time.Stamp)
},
}))
@techslides
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment