# Date displayed different than in database

**URL:** https://forum.servoy.com/t/date-displayed-different-than-in-database/11963
**Category:** Classic Servoy
**Created:** [March 29, 2010, 1:09pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963 "2010-03-29T13:09:24Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [March 29, 2010, 1:09pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/1 "2010-03-29T13:09:24Z")

</div>

Hi everybody,

Today I have discovered a strange behaviour in my solution: some dates are displayed with 1 day less.  
Here is what is present in the database: [attachment=1]Capture2.PNG[/attachment]  
Here is what is displayed in the solution: [attachment=0]Capture1.PNG[/attachment]  
As you can see some dates are the same and others are different. The highlighted records is quite interesting because only the From date is incorrect ![:shock:]( "Shocked")  
Data is directly displayed from the database, there is no calculation made.

This is on our production server (Servoy 5.1.0) . On developer (5.1.0) it works fine (dates are well displayed). On our test server (5.1.1) it works fine as well.  
The only difference I have noticed is that on the test server and Developer the time is in BST (correct current time) while on the production server has UTC time (one hour less). But on all of them have servoy.use.client.timezone is set to True. So their might be a link with the date minus 1 day and the time minus 1 hour, as the time in the dates is 00H00 ![:roll:]( "Rolling Eyes")  
But if it’s that, why not doing it for all dates?!

Any idea?

Thanks

 ![Capture1.PNG](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/f/f4f09e3035209cf90749217508e8ad38109401ef.png)

 ![Capture2.PNG](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/a/acde755e356ba77ef78ca4cb5b246a196856a6b0.png)

---

<div class="post-metadata">

### Author: ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)
#### Post date: [March 29, 2010, 1:46pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/2 "2010-03-29T13:46:16Z")

</div>

> Foobrother:  
> But if it’s that, why not doing it for all dates?!

DST problem??

DST ends somewhere end of October…

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [March 29, 2010, 1:52pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/3 "2010-03-29T13:52:23Z")

</div>

> mboegem:  
> DST problem??
> 
> DST ends somewhere end of October…

Looks like our problem happened this weekend for the BST (British Summer Time) change ![:roll:]( "Rolling Eyes")

---

<div class="post-metadata">

### Author: ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)
#### Post date: [March 29, 2010, 1:54pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/4 "2010-03-29T13:54:54Z")

</div>

Still can’t be a coincidence I guess…  
DST ended 25th of October 2009, all dates before do have an offset

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [March 29, 2010, 2:05pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/5 "2010-03-29T14:05:18Z")

</div>

Indeed, but I have other examples with dates after October 2009. Even date in the future.

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [March 29, 2010, 2:24pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/6 "2010-03-29T14:24:50Z")

</div>

Fixed!

We just had to restart the server which was up for several days. The time became BST and the date came back to normal.  
So that’s definitely a bug in my opinion. You shouldn’t have to restart the server for it to pickup the right time ![:roll:]( "Rolling Eyes")

---

<div class="post-metadata">

### Author: ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)
#### Post date: [March 29, 2010, 2:55pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/7 "2010-03-29T14:55:49Z")

</div>

> Foobrother:  
> So that’s definitely a bug in my opinion. You shouldn’t have to restart the server for it to pickup the right time ![:roll:]( "Rolling Eyes")

Yes, please file a [bug report](http://www.servoy.com/s).

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [March 29, 2010, 3:18pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/8 "2010-03-29T15:18:59Z")

</div>

Case 282436 created.  
By the way, I’m very surprised nobody else has this issue. Maybe they didn’t notice it yet ![:roll:]( "Rolling Eyes")

---

<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 30, 2010, 8:35am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/9 "2010-03-30T08:35:49Z")

</div>

see his first post:

> But on all of them have servoy.use.client.timezone is set to True.

---

<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 30, 2010, 8:39am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/10 "2010-03-30T08:39:58Z")

</div>

yes didnt see that.

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [April 29, 2010, 9:53am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/11 "2010-04-29T09:53:07Z")

</div>

I’m replying to the case update of Johan here, as I don’t know how to reply on the CRM system.

> Johan:  
> so to get the complete picture  
> You production server kept running over a weekend that had a DST change right?

Yes.

> Johan:  
> Problem is that this seems to be deepily into the java virtual machine. It seems that TimeZone instances we ask from the server are not adjusted on the fly when we ask it before and after a dst change.  
> (at least that is now my guess)

If you are right, this is a big weakness of the JVM.  
It means that any application server using the JVM and only rebooting once a week can potentially get the same problem that we had?! ![:shock:]( "Shocked")

---

<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: [April 29, 2010, 10:33am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/12 "2010-04-29T10:33:15Z")

</div>

i am looking into it, the thing is that there is another option  
new clients that came in after the dst change also show those problems?  
Because then maybe we cache the client time zone incorrectly on the server. But then only clients that keep connected on the server over a DST change should have this problem  
new clients that are connection after the dst change happened should not have this problem then.

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [April 29, 2010, 10:44am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/13 "2010-04-29T10:44:12Z")

</div>

> jcompagner:  
> new clients that came in after the dst change also show those problems?

Yes. People are connecting daily. But they were not really new in the sens that they already connected before and didn’t have a clean empty cache. Maybe the old timezone still was in their cache? ![:roll:]( "Rolling Eyes")

---

<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: [April 29, 2010, 10:54am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/14 "2010-04-29T10:54:24Z")

</div>

no that cant be it, a new client is completely fresh with its current timezone info.

This is extremely hard to reproduce or to test. And looking in the code i have currently no idea where this behavior exactly is in.

TimeZone information doesnt really change as far as i can see before the DST and after… (it just holds the info)  
And if new clients do see the problem (and maybe old clients where not seeing it, this would also be go to know, but not really easy to reproduce)  
then it has to be something on the server.

---

<div class="post-metadata">

### Author: ![Foobrother](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@Foobrother](https://forum.servoy.com/u/Foobrother)
#### Post date: [April 29, 2010, 11:31am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/15 "2010-04-29T11:31:46Z")

</div>

Unfortunately I can’t give you more information than the details in my 1st post and the fact that every client are connecting/disconnecting everyday and very often several times a day. However we never clear their cache (except when they have issues specific to them).  
But what is sure is, that before restarting the server it had UTC timezone and after the reboot BST. And I’m 99% sure nobody connected yet when I have checked after the reboot.

Anyway, we will wait till winter time to check it again ![:lol:]( "Laughing")

---

<div class="post-metadata">

### Author: ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)
#### Post date: [May 20, 2010, 7:52am UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/16 "2010-05-20T07:52:35Z")

</div>

Hi,

You are not the only one with this issue,

I restarted our Servoy 3.5.12 server late yesterday and now we are having problems with the times and dates of appointments in our diary (IT2BeCalendar) and in Servoy list views. We have ‘servoy.use.client.timezone’ false, actually never noticed that setting before. And clients set to Europe/London. Quick-fixed this yesterday by subtracting one hour from appointments after 28 March. But our list views are still incorrect.

When I fire the actual query directly on the PostgreSQL database it works as expected. It looks like Servoy is shifting timestamp parameters before sending them to the backend database. If I relaunch client in GMT timezone, the list looks as expected.

---

<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: [May 20, 2010, 1:24pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/17 "2010-05-20T13:24:22Z")

</div>

you should have this servoy.use.client.timezone set to true

Especially when you deploy for the first time and dont have inserted any dates yet in the database.

I think you hit the problem that the server shifted to UTC (you can see this on the admin pages) when it should be in Europa/London (thats your 1 hour difference)

If you had you have the property on true you wouldnt notice that the server has a different timezone then before.  
But then all your dates should be inserted when the clients and the server where in the same timezone else there you could see a bit of difference.

---

<div class="post-metadata">

### Author: ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)
#### Post date: [May 20, 2010, 2:00pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/18 "2010-05-20T14:00:03Z")

</div>

Hi Johan,

I kicked all the users out for a minute over the lunch break and set servoy.use.client.timezone set to true  
and this has fixed the problem. I’m a little confused, this system has been running for about 4 years and we  
have never had this problem before.

I did start a Developer on the server machine by accident and I wonder if it has somehow mangled the prefs file for the 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: [May 20, 2010, 3:51pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/19 "2010-05-20T15:51:52Z")

</div>

dont know  
keep monitoring in what time zone the server is in  
If that suddenly changes again then there is something in servoy that does that and that should be fixed.

that property to true is a better solution anyway

---

<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: [May 20, 2010, 6:05pm UTC](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963/20 "2010-05-20T18:05:27Z")

</div>

> jcompagner:  
> you should have this servoy.use.client.timezone set to true
> 
> Especially when you deploy for the first time and dont have inserted any dates yet in the database.

Johan, we are in the situation, that we have allready have a solution in production, with this setting to false (in Servoy 3 and \< we did’nt had this property)  
What should we do, if we want to convert to servoy.use.client.timezone set to true

or what are the consequences if we do that?

[Next page](https://forum.servoy.com/t/date-displayed-different-than-in-database/11963.md?page=2)
