WebClient and Timezone

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

WebClient and Timezone

Postby steve1376656734 » Sat Mar 21, 2015 5:55 pm

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):

Servoy Timezone Issue.png
Servoy Timezone Issue.png (86.61 KiB) Viewed 6183 times


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
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: WebClient and Timezone

Postby Harjo » Sun Mar 22, 2015 11:18 am

I think this is coming from your server!
So have a look on what timezone, your server is.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: WebClient and Timezone

Postby steve1376656734 » Sun Mar 22, 2015 8:41 pm

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
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: WebClient and Timezone

Postby jcompagner » Mon Mar 23, 2015 5:20 pm

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
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: WebClient and Timezone

Postby steve1376656734 » Mon Mar 23, 2015 5:54 pm

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.
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: WebClient and Timezone

Postby jcompagner » Mon Mar 23, 2015 5:58 pm

what time stamps are that exactly? where are those generated? Purely by the db or are these configured and generated by servoy?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: WebClient and Timezone

Postby steve1376656734 » Mon Mar 23, 2015 6:18 pm

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
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: WebClient and Timezone

Postby patrick » Tue Mar 24, 2015 10:39 am

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...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: WebClient and Timezone

Postby jcompagner » Tue Mar 24, 2015 11:45 am

steve are all the servers/developers/db servers working in the same timezone?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: WebClient and Timezone

Postby steve1376656734 » Tue Mar 24, 2015 12:38 pm

:oops:

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
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 9 guests

cron