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?

有帮助吗?

解决方案 2

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

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

其他提示

Try this:

return dt.AddHours(1).ToString("D", new CultureInfo("en-US"));
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top