Guest User

Untitled

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