What i plan to do is, create a table of TimeZone in database, based on user timezone, i convert the time into UTC before saving to database and while retriving the time convert from UTC to user timezone.
Windows 8 Professional 64 Bit.
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
bhanu2217
Member
527 Points
458 Posts
TimeZoneInfo FindSystemTimeZoneById
Jul 19, 2011 04:10 AM|LINK
I am using following statement.
How can i get the list of all the ID's? e.g "India Standard Time" or "UTC" or "Tokyo Standard Time"
There might be some list of these name right?
I mean what name do i refer other countries by? or can i pass a offset value also to this? Like +5.5 or so?
TimeZoneInfo cstZone1 = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); TimeZoneInfo cstZone2 = TimeZoneInfo.FindSystemTimeZoneById("UTC"); DateTime cstTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(currdatee, cstZone1.Id.ToString(), cstZone2.Id.ToString());What i plan to do is, create a table of TimeZone in database, based on user timezone, i convert the time into UTC before saving to database and while retriving the time convert from UTC to user timezone.
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
bhanu2217
Member
527 Points
458 Posts
Re: TimeZoneInfo FindSystemTimeZoneById
Jul 21, 2011 04:54 AM|LINK
Is there a list like this of all the countries/timezones that i can access to convert from one timezone to another?
http://pietschsoft.com/post/2007/06/23/NET-35-How-to-Convert-from-one-TimeZone-to-another.aspx
Visual Studio 2012
Sql Server 2012
-------------------------------------
www.HermesWritings.com
Yanping Wang...
Star
14919 Points
1537 Posts
Microsoft
Re: TimeZoneInfo FindSystemTimeZoneById
Jul 21, 2011 05:39 AM|LINK
Hi bhanu2217,
The example in MSDN article lists the identifier of each of the time zones defined on the local computer. please refer:
http://msdn.microsoft.com/en-us/library/system.timezoneinfo.id.aspx
hope this helps, thanks.
Feedback to us
Develop and promote your apps in Windows Store