View Problem
Parse a date and time from a string
Given the string
Submit a new solution for erlang, clojure, groovy, or fsharp
There are 14 other solutions in additional languages (cpp, csharp, fantom, go ...)
"2008-05-06 13:29", parse it as a date representing 6th March, 2008 1:29:00pm in the local time zone.
fsharp
let dateTime = DateTimeOffset.Parse("2008-05-06 13:29")
// Use format specifiers to appropriately format string
// 1. Default culture
printfn "%s" (dateTime.ToString("d MMMM, yyyy h:mm:sstt"))
// 2. Nominated culture
Console.WriteLine("{0}", dateTime.ToString("d MMMM, yyyy h:mm:sstt"), Globalization.CultureInfo.CreateSpecificCulture("en-us"))
// Use format specifiers to appropriately format string
// 1. Default culture
printfn "%s" (dateTime.ToString("d MMMM, yyyy h:mm:sstt"))
// 2. Nominated culture
Console.WriteLine("{0}", dateTime.ToString("d MMMM, yyyy h:mm:sstt"), Globalization.CultureInfo.CreateSpecificCulture("en-us"))
Submit a new solution for erlang, clojure, groovy, or fsharp
There are 14 other solutions in additional languages (cpp, csharp, fantom, go ...)




