# Incorrect timezone offset in WebClient

**URL:** <https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476>\
**Category:** Classic Servoy\
**Created:** [December 4, 2009, 10:17pm UTC](https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476 "2009-12-04T22:17:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 4, 2009, 10:17pm UTC](https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476/1 "2009-12-04T22:17:45Z")

</div>

Dates in WebClient are returning back incorrect offset, even though it shows correct time zone. For example:  
“now:” + new Date()  
Will return:  
Now:Fri Dec 04 2009 22:00:57 GMT-0000 (EST) - In WebClient  
Now:Fri Dec 04 2009 17:00:57 GMT-0500 (EST) - In SmartClient

Notice the time zone of EST is correct, but hour offset is incorrect. Server and client are in same time zone. As well as Servoy Admin page shows:  
Current time: Fri Dec 04 17:00:57 EST 2009  
Also interesting is that:  
“TimeZone Offset:” + i18n.getTimeZoneOffset(i18n.getCurrentTimeZone())  
returns:  
TimeZone Offset:-18000000 - In both Smart and Web.

servoy.use.client.timezone is true.  
Servoy version 4.1.4 -build 681  
java.version=1.6.0\_15-b03  
Windows Server 2003 Service Pack 2

Any ideas? This causes big problems in web client when I have a relationship based on the date to show related data.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 7, 2009, 12:42pm UTC](https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476/2 "2009-12-07T12:42:20Z")

</div>

are you talking here purely on dates that are in mem or also on database dates?  
If database dates what is the setting of “servoy.use.client.timezone” in the admin page?  
do you have that on false or true? please set it to true.

i just make a quick example that fills in a form dataprovider with what you also do like "now: " + new Date();  
and when i do this in the web i get:

now: Mon Dec 07 2009 13:37:02 GMT+0100 (CET)

and in the smart i get:

now: Mon Dec 07 2009 13:37:06 GMT+0100 (CET)

I tested this all on localhost (server and both clients) and 1 setup where 2 clients on a different machine where talking to the same app server.

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [December 8, 2009, 3:27am UTC](https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476/3 "2009-12-08T03:27:14Z")

</div>

This was a weird one. Had to do a full server restart, and play with the Server timezone settings. Seems like sometimes Windows Server 2003 can read timezone from incorrect registry, and if it hasn’t update from the network time server in a while, you can get some weird issues. Changed from [time.windows.com](http://time.windows.com) to [time.apple.com](http://time.apple.com) for a more reliable time as well ![;)]( "Wink") So, after playing with some settings, and a restart, all is back to normal.

---

<div class="post-metadata">

**Author:** ![amcgilly](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@amcgilly](https://forum.servoy.com/u/amcgilly)\
**Post date:** [August 24, 2012, 9:33pm UTC](https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476/4 "2012-08-24T21:33:37Z")

</div>

I have a question for Servoy about i18n.getTimezoneOffset().

i18n.getTimeZoneOffset(timezone, date) will give the offset in effect in the specified timezone at the specified date. This is incredibly useful because it will even take into account whether daylight savings is in effect at the specified date. What I’m wondering is, how is the ‘data’ behind this maintained? Countries change their daylight savings rules from time to time - not often but it does happen. Where does that data live, and how will it be updated when these changes occur?

This question also applies to Date.getTimezoneOffset(), seeing it too takes daylight savings into consideration for the current timezone.

Thank you.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 27, 2012, 8:16am UTC](https://forum.servoy.com/t/incorrect-timezone-offset-in-webclient/11476/5 "2012-08-27T08:16:40Z")

</div>

That comes from java itself, So you need to update your java version now and then to have the latest  
They also have a special tool for that, but more info is here: [http://www.oracle.com/technetwork/java/ … 37583.html](http://www.oracle.com/technetwork/java/javase/timezones-137583.html)
