Question

Right now this string is returning: "Giovedi 24 Ottobre 2013", which is absolutely correct. I have adjust the result with a +1 hour for my specific needs. I need the string to return "Thursday 24 October 2013", basically the same but in English.

 private string Datetime()

{
    DateTime dt = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now);

    return dt.AddHours(1).ToLongDateString();
}

How can I change the method to return the date in English?

Was it helpful?

Solution 2

You don't really need to use the TimeZoneInfo class to do this...

return DateTime.UtcNow.ToString("D", new CultureInfo("en-US"))

OTHER TIPS

Try this:

return dt.AddHours(1).ToString("D", new CultureInfo("en-US"));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top