white smartphone

How to retreive the TimeZone programatically in Windows Phone ?

The Windows Phone users can set the time zone via the Settings -> Datetime Form in the Windows Phone.

By default , the time zone was “UTC +05:30 Chennai,Kolkatta,Mumbai,New Delhi” on my Windows Phone that was set via the “Set automatically” option.

How to retreive the TimeZone programatically in Windows Phone ?
How to retreive the TimeZone programatically in Windows Phone ?

If you want to retreive this information (Timezone) , you can use the TimeZoneInfo.Local property that is defined in the System.Security NameSpace .

TimeZoneInfo.Local includes the properties StandardName and DisplayName to display the time zone.

txtTimeZone.Text = TimeZoneInfo.Local.StandardName;

The StandardName will display the complete text like “UTC +05:30 Chennai,Kolkatta,Mumbai,New Delhi”

txtTimeZone.Text = TimeZoneInfo.Local.DisplayName;

The DisplayName will inturn display the Zone Name like “India Standard Time”

    1 Comment

  1. Georgy
    May 22, 2015
    Reply

    Hi Senthil,
    Do you know if I can set the application’s time zone? I have a server-client application and want to use the server’s time zone. Converting all date’s from one to another creates additional code. Application is intended to use only server’s time zone.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...