API Questions on Kentico API.
Version 6.x > API > A way to detect the system timezone? View modes: 
User avatar
Member
Member
guillaume.marquilly-tv5monde - 10/11/2012 5:08:45 AM
   
A way to detect the system timezone?
Hi!,

I have a feature of timezone selection. I used the timezones from Kentico administration in my dropdownlist.

I would like to know how to get the computer timezone in order to preselect the right timezone?

Thank you!

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/11/2012 9:19:43 AM
   
RE:A way to detect the system timezone?
Hi,

I've found some methods for you that should work:
1. getTimezoneOffset
2. Setting your website DateTime according to Time Zone Offset of the client

3. SOLVED: How to get client machine time zone

I hope that one of these will help you.

Best regards,
Martin Danko

User avatar
Member
Member
guillaume.marquilly-tv5monde - 10/11/2012 10:57:22 PM
   
RE:A way to detect the system timezone?

With System.Timezone, we can get the current system timezone, but in Kentico, its not the same IDs or standard names compared to the classic .net functions.

You can have different regions with the same offset sometimes, depending on the daylights, but they are not the same so I don't like to use the offset to compare.

No other idea?

Thank you!


User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/15/2012 10:42:02 AM
   
RE:A way to detect the system timezone?
Hi,

I'm afraid I haven't found something that will fit your needs.

Please take a look at the DevGuide - TimeZones module: Displaying correct time in your code maybe you will find something helpful for you (some API code).

Best regards,
Martin Danko