Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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