Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GetTimeStamp returns a timestamp in a file name friendly, version of the RFC3339
- // format. The string produced by RFC3339 includes a couple colons ':' that are not
- // friendly to most filenames (unix and dos a like). The colons need to be escaped
- // if used in a filename, since they are useless, we'll rip em.
- func TimeStamp() string {
- ts := time.Now().UTC().Format(time.RFC3339)
- return strings.Replace(ts, ":", "", -1) // get rid of offensive colons
- }
Add Comment
Please, Sign In to add comment