cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp returns different values in WD

Former Member
0 Kudos

Hi everyone,

I'm having a rather strange problem when using a Web Service to bring back some Date values from a database. When I select a date value in WD and save it to the database, it works fine. I've checked the date saved and there is no problem. When I call the web service and bring the field back, it does so with a Timestamp object.

The date that appears on screen in my WD application is one day before the date on the database. Upon further analysis, I found that the Timestamp that is brought back is actually 10 hours before the Timestamp that is in the database. Has anyone ever heard of something like this happening? I definitely don't want to hard code an additional 10 hours to every date in order to solve the problem.

Thanks,

Luis

Accepted Solutions (0)

Answers (1)

Answers (1)

sanyev
Active Participant
0 Kudos

Hi Luis,

I guess this is a time zone issue. When ever there you are saving date time or timestamp to the backend system the time is converted to UTC (Coordinated Universal Time). So while storing the timestamp in the database it uses your timezone to convert the timestamp to UTC. While retrieving the timestamp webdynpro converts the timestamp to your timezone. So if the timestamp you are saving to the database doesn't have your timezone then while converting to UTC it could be wrong. Similarly it could go wrong while retrieving the timestamp back from the database.

There could be one more issue that is possible. If in your UI you are using a Date field and in the database you are using a Date time or a timestamp there could be problem. While saving the data to the database it append 12 midnight to the time to the date field. While retrieving the date back and then applying the timezone could possibly change the data to the next or previous date.

Search the SDN for timezone issues like [this|;.

Regards,

Sanyev