This is my code:
using System;
using System.Globalization;
public class Program
{
public static void Main()
{
CultureInfo cultureInfo = new CultureInfo("ru");
DateTimeOffset dt;
bool parseSuccess = DateTimeOffset.TryParse("Ср, 17 фев 2021 15:03:25 +0300",
cultureInfo.DateTimeFormat, DateTimeStyles.None, out dt);
Console.WriteLine(dt.ToUniversalTime());
}
}
Date String: "Ср, 17 фев 2021 15:03:25 +0300"
I need the output from 3.1 but in 5.0 and I've tried quiet a few solutions which didn't work and I'm not sure why. When I debug it, it says that the date is not a correct date format but then why does it work in 3.1 and not 5.0?