Converts string to DateTimeOffset:"15/09/07 08:45:00 +1:00"
using System;
using System.Globalization;
public class Test
{
public static void Main()
{
DateTimeFormatInfo fmt = new CultureInfo("fr-fr").DateTimeFormat;
string dateString;
DateTimeOffset offsetDate;
dateString = "15/09/07 08:45:00 +1:00";
offsetDate = DateTimeOffset.Parse(dateString, fmt);
Console.WriteLine("{0} returns {1}", dateString, offsetDate.ToString());
}
}
Related examples in the same category