This is a quicky, what do I need to setup a different timzone in my application than that setup on IIS
All i want is to show a specific date in AESP rather than SPT, ist here a way in C# .NET 3.5?
This is a quicky, what do I need to setup a different timzone in my application than that setup on IIS
All i want is to show a specific date in AESP rather than SPT, ist here a way in C# .NET 3.5?
Try TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destTimeZone)
I figured it out:
DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
dtfi.FullDateTimePattern = "yyyy-MM-ddTHH:mmzzz";
DateTime s = DateTime.Parse(inputstring, dtfi);
s = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(s, "AUS Eastern Standard Time");
TimeZoneInfo tzz = TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time");
string timezone = (tzz.IsDaylightSavingTime(s)) ? tzz.DaylightName : tzz.StandardName;
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-AU");
string output = String.Format("{0} | {1}", s.ToString("f", culture), timezone);
so input is: 2009-10-13T10:00-7:00
output is: Wednesday, 14 October 2009 4:00 AM | AUS Eastern Daylight Time
input is: 2009-9-13T10:00-7:00
output is: Monday, 14 September 2009 3:00 AM | AUS Eastern Standard Time