Skip to content

Instantly share code, notes, and snippets.

@javouhey
Last active August 29, 2015 13:57
Show Gist options
  • Save javouhey/9589569 to your computer and use it in GitHub Desktop.
Save javouhey/9589569 to your computer and use it in GitHub Desktop.
#golang parse video time spec on CLI
const (
mylayout = "15:04:05"
)
t2, _ := time.Parse(mylayout, "23:59:59") // (EXTRA time.Time=0000-01-01 23:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "3:59:59") // (EXTRA time.Time=0000-01-01 03:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "03:59:59") // (EXTRA time.Time=0000-01-01 03:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "13:59:59") // (EXTRA time.Time=0000-01-01 13:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "1:59:59") // (EXTRA time.Time=0000-01-01 01:59:59 +0000 UTC)
// @see http://play.golang.org/p/SPyjsNullP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment