Skip to content

Instantly share code, notes, and snippets.

@Thorium
Created March 4, 2012 10:43
Show Gist options
  • Save Thorium/1972349 to your computer and use it in GitHub Desktop.
Save Thorium/1972349 to your computer and use it in GitHub Desktop.
Timestamp with timezone (YYYYMMDDhhmmssffff+zzzz)
let myTimeStamp =
let zone = System.TimeZone.CurrentTimeZone.GetUtcOffset System.DateTime.Now
let prefix = match (zone<System.TimeSpan.Zero) with | true -> "-" | _ -> "+"
System.DateTime.UtcNow.ToString("yyyyMMddHHmmssffff") + prefix + zone.ToString("hhss");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment