Converts string to DateTimeOffset using the specified culture-specific format information.
using System;
using System.Globalization;
public class Test
{
public static void Main()
{
DateTimeFormatInfo fmt = new CultureInfo("fr-fr").DateTimeFormat;
string dateString;
DateTimeOffset offsetDate;
dateString = "03-12-07";
offsetDate = DateTimeOffset.Parse(dateString, fmt);
Console.WriteLine("{0} returns {1}", dateString, offsetDate.ToString());
}
}
Related examples in the same category