Answers for "c# datetime parsing format"

C#
0

c# date parse

this.Text="22/11/2009";

DateTime date = DateTime.ParseExact(this.Text, "dd/MM/yyyy", null);
Posted by: Guest on February-05-2021
0

c# parsing datetime from string irrespctive of culture

CultureInfo.GetCultures(CultureTypes.AllCultures).Select(culture => {
    DateTime result;
    return DateTime.TryParse(
        "8 avril 2016 vendredi", 
        culture, 
        DateTimeStyles.None, 
        out result
    ) ? result : default(DateTime?);
})
.Where(d => d != null)
.GroupBy(d => d)
.OrderByDescending(g => g.Count())
.FirstOrDefault()
.Key
Posted by: Guest on August-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language