# WebClient and Timezone

**URL:** <https://forum.servoy.com/t/webclient-and-timezone/18405>\
**Category:** Classic Servoy\
**Created:** [March 21, 2015, 3:55pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405 "2015-03-21T15:55:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [March 21, 2015, 3:55pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/1 "2015-03-21T15:55:25Z")

</div>

Hi,

I have a question regarding web clients and timezones. I have a server located in the UK and all my web clients are also located in the UK but if I click on a client in the Servoy administrator it says that their timezone is Africa/Casablanca (see screenshot):

[attachment=0]Servoy Timezone Issue.png[/attachment]

Can anyone explain why the clients have this timezone and how I can set it correctly?

One other oddity is if I dump metadata from my local database and then from the server database and compare the two files then all the timestamps differ by 1 hour which is incredibly annoying when trying to find out what records have changed.

Thanks  
Steve

 ![Servoy Timezone Issue.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/5/5b214fd8c0ddf17d07ae980986b627bcb4217985.png)

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 22, 2015, 9:18am UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/2 "2015-03-22T09:18:41Z")

</div>

I think this is coming from your server!  
So have a look on what timezone, your server is.

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [March 22, 2015, 6:41pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/3 "2015-03-22T18:41:17Z")

</div>

Hi Harjo,

Good thought but I had already checked that. The system is running on Centos 6.6 and the system timezone is set to Europe/London, I have also checked the postgresql.conf file and the timezone there is set to “GB”.

Thanks  
Steve

---

<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:** [March 23, 2015, 3:20pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/4 "2015-03-23T15:20:36Z")

</div>

no this is comming from the webclient  
because the browser doesn’t give us enough info to really see what the exact time zone is  
We need to guess it based on timezone offset and dst offset

then the first hit is that Africa/Casablanca

the only thing that can be improved i guess (there is a todo for that in code i believe)  
is that if the current timezone offsets match the timezone of the server then just take that one  
But that will only fix that specific scenario where the clients are in the exact same timezone as the server

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [March 23, 2015, 3:54pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/5 "2015-03-23T15:54:43Z")

</div>

Thanks for clarifying that Johan.

Still not sure why my local development machine and the server differ by 1 hour on the DB timestamps though - guess I’ll need to double check all my config again.

---

<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:** [March 23, 2015, 3:58pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/6 "2015-03-23T15:58:10Z")

</div>

what time stamps are that exactly? where are those generated? Purely by the db or are these configured and generated by servoy?

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [March 23, 2015, 4:18pm UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/7 "2015-03-23T16:18:37Z")

</div>

It is a bit of an odd situation really.

I have a DB on the server which I back up using pg\_dump. I then restore it on my developer machine using pg\_restore to make sure I have an exact copy of the current live database. I then go on to do some development and when ready to publish I will update the metadata from the DB to the workspace file and check the code into my repository. Finally before publishing the update I change the database connection properties on my developer to point directly to the live database and dump the metadata again in order to compare the two files to see if anything has been changed on the live server prior to publishing the update. At that point the timestamps between the locally dumped data and the server dumped data differ by EXACTLY 1 hour on all records (even though nothing else has changed on them!)

I am at a bit of a loss to explain it.

Thanks  
Steve

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 24, 2015, 8:39am UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/8 "2015-03-24T08:39:59Z")

</div>

Not sure if that is your problem, but the other day all my dates were 2 days off even. It turned out that I was using an outdated JDBC driver. That happened with SQL Server…

---

<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:** [March 24, 2015, 9:45am UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/9 "2015-03-24T09:45:59Z")

</div>

steve are all the servers/developers/db servers working in the same timezone?

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [March 24, 2015, 10:38am UTC](https://forum.servoy.com/t/webclient-and-timezone/18405/10 "2015-03-24T10:38:40Z")

</div>

![:oops:]( "Embarassed")

Double checked all the configuration and it turns out that the PostgreSQL server on the developer machine was set incorrectly. Changed it to the correct one and rebooted and it seems to be fine now.

Patrick - should I update the JDBC driver every time I update the PostgreSQL server? If so does it need a specific name for the .jar file in the Drivers directory or can I name it with the version number so I can easily see what is happening? Also if I upgrade the developer/application server will it overwrite this driver with the one included with Servoy?

Thanks for all the advice and apologies for my error!

Steve
