0

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?

FeliceM
  • 4,163
  • 9
  • 48
  • 75

2 Answers2

3

Try this:

return dt.AddHours(1).ToString("D", new CultureInfo("en-US"));
Hamlet Hakobyan
  • 32,965
  • 6
  • 52
  • 68
0

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

return DateTime.UtcNow.ToString("D", new CultureInfo("en-US"))
Jeff B
  • 8,572
  • 17
  • 61
  • 140
  • this solved my problem. Thanks a lot. I used return dt.AddHours(1).ToString("D", new CultureInfo("en-US")); – FeliceM Oct 24 '13 at 21:42