Date field and date dataprovider is displayed incorrect

Forum to discuss the Web client version of Servoy.

Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Tue Jun 09, 2009 1:37 pm

Hi,
I am encountering this weird issue when running an application build for Servoy 3.5.7's web client:
I have a date field: format dd-mm-yyyy, and a date dataprovider: 1-05-1953. The same browser (including version), accessing the application from 2 different machines displays this date differently:
1) 1-05-1953
2) 30-04-1953
So it extracts 1 day from the date.
I am sure the date in the database is 1-05-1953, do you have an idea why this is happening?

Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby Harjo » Tue Jun 09, 2009 1:49 pm

check if both machines are on the same timezone!

(I think not ;-) )
Harjo Kompagnie
byKom B.V.
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: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Tue Jun 09, 2009 2:13 pm

Hi Harjo,

The servoy.use.client.timezone property is set to "false" in servoy-admin. To make sure you understand what i mean: there are 2 clients of the same application open: one on my PC,one from a remote server. Even if the dataprovider is 1-05-1953, the remote browser displays 30-04-1953. The same version of browser dispalys the data correct: 1-05-1953 on my local PC. Is there a setting that causes this to happen?
Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby Harjo » Tue Jun 09, 2009 2:24 pm

yes, still check both timezones of both PC's

are they the same?
(if it is window, doubleclick in the rightbottom corner on the clock, choose the second tab)
Harjo Kompagnie
byKom B.V.
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: Date field and date dataprovider is displayed incorrect

Postby Harjo » Tue Jun 09, 2009 2:25 pm

ahh...... it's webclient!! :oops:

hmmm that is weird,
Harjo Kompagnie
byKom B.V.
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: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Tue Jun 09, 2009 2:34 pm

They are different indeed:
local: GMT+2
remote: GMT+1
Is there a way not to take this in consideration when displaying the date?
Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby Harjo » Tue Jun 09, 2009 2:50 pm

oke, than it IS working the same as in a smart-client.

a date like 12-01-2009 00:00 set in GMT+2 will present like: 11-01-2009 23:00 in GMT+1 (this is standard behaviour)

do not exactly know, how you can prevent this.
Harjo Kompagnie
byKom B.V.
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: Date field and date dataprovider is displayed incorrect

Postby Harjo » Tue Jun 09, 2009 2:51 pm

look here: http://forum.servoy.com/viewtopic.php?t=10806

Timezone Behavior Change
Important behavior change: by default, the property "servoy.use.client.timezone" is set to true.

Property description:
When true the client timezone will be used to convert to the server/database timezone. It is highly recommended to use true as default to always see the correct/same dates/times in all clients (regardless of their timezone).
Harjo Kompagnie
byKom B.V.
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: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Tue Jun 09, 2009 3:48 pm

This fixed the problem.
Thanks a lot Harjo!
Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Mon Jun 15, 2009 11:07 am

Hello,

Is it possible that setting servoy.use.client.timezone = true messes up the existing dates in the database?
(For records previously introduced from a place with time zone GMT+9: the dates now show one day less. For other time zones the dates are displayed correctly, I am confused..)

Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby jcompagner » Mon Jun 15, 2009 1:30 pm

Hi Dianna,

no it doesnt mess up the data in the database. It just returns now a different end result.
Because it interpers the date now different at the server/client.

for example if you have that property to false:

Client in TimeZone X sends Date X (10:00) -> send to server in TimeZone Z -> Saves Date X as is (seen as 11:00 at the server)
Client in TimzeZone Y reads Date X and sees that date in its own time (12:00)


set the property to true:

Client in TimeZone X sends Date X (10:00) -> send to server in TimeZone Z -> Date saved converted so that it is also seen as 10:00 at the server
Client in TimzeZone Y reads Date X and sees again that date converted to its own time also at 10:00

So with that property to true, no matter where you are you will see the inserted time (so the toString() of the date is everywhere the same)
If you want to support multiply timezone's then you have to store that besided the time column so that you know that 10:00 is really 10 at timezone X.

But now back to the question.

If you have dates inserted without the property. then read with the property it will do conversion so the Client in TimeZone X that sends the date with time: 10:00
but that time was at the servers timezone 11:00 then with the property suddenly on the client in TimeZone X will see that date as 11:00
(because the times are from the server on "stable")

so it seems to be messed up for you yes. Because now the previous times are converted to always see the exact toString() the server sees.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8846
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Mon Jun 15, 2009 2:32 pm

Thank you very much for the clearings Johan!
If i understood correctly,the data seems to be "messed up" for me only for the dates introduced when property was on false. So from now on (property = true) the dates will always be the same: the ones on the server. Please correct me if I am wrong.

Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby jcompagner » Mon Jun 15, 2009 3:53 pm

yes if the property is on true then where ever a date like "2009-15-06 10:30" is inserted from, what ever timezone
it will always come out exactly the same on what ever time zone you view it again in.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8846
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Mon Jun 15, 2009 4:45 pm

Thanks Johan!
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Re: Date field and date dataprovider is displayed incorrect

Postby diana.bodnarescu » Wed Jul 08, 2009 2:57 pm

So with that property to true, no matter where you are you will see the inserted time (so the toString() of the date is everywhere the same)

Hi,
I have the property on TRUE and yet there is an hour difference between what is in the database and what is displayed in the client for new created records, so records created with property set on TRUE. I posted the same issue in "Time displayed with different values in web and smart client", because first I thought of it as a different issue..
I really need your help on this one,a wrong date is incorrect info displayed to the user and it has bad consequences..
Many thanks in advance!
Diana
Diana Bodnarescu
Stb Software Development
SAN Partner
User avatar
diana.bodnarescu
 
Posts: 137
Joined: Fri Sep 05, 2008 1:21 pm

Next

Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 3 guests

cron