Converts string to DateTimeOffset:"mar. 1 janvier 2008 1:00: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 = "mar. 1 janvier 2008 1:00:00 +1:00";
offsetDate = DateTimeOffset.Parse(dateString, fmt);
Console.WriteLine("{0} returns {1}", dateString, offsetDate.ToString());
}
}
Related examples in the same category