cancel
Showing results for 
Search instead for 
Did you mean: 

Client local time

Former Member
0 Kudos

Hi all,

My application presents to the client updates every couple of minutes.

I want to write the local time (of the client) together with the update.

The changes of the UI are done in the server side. In the server side I can get only the server local time - meaning I got a wrong time (if i am in Germany, and the server is in the US).

Is there a way to send the local client time to the server? Or, any other workaround to solve this issue

Thanks,

Noy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

use the following code

TimeZone zone = TimeZone.getTimeZone("GMT+3");

DateFormat dateFormat = DateFormat.getDateTimeInstance();

dateFormat.setTimeZone(zone);

String time = dateFormat.format(Calendar.getInstance().getTime());

Regards

AD

former_member182372
Active Contributor
0 Kudos

Hello Noy,

Try to use IUser.getTimeZone ( https://media.sdn.sap.com/javadocs/NW04/SP9/ume/com/sap/security/api/IUser.html )

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

Thanks for your answer, but still, this time zone is the IUser time zone. The IUser time zone is determining according to the user properties, and not the current client time.

To be clearer, if I work in Germany I will determine my time zone to Germany in my user properties, but if I'll travel to the US, and change the time zone in my operation system without changing my user properties, I will get the wrong time.

What I want to do is to set the time according to the time zone of the client operation system.

former_member182372
Active Contributor
0 Kudos

Hello Noy,

Well, if this requirement is very critical you can try following - create dispatcher (jsp or simple html), include JavaScript code which fetches local user time and time zone, builds URL to WD Application and passes through URL parameters, and redirects to URl. Ffetch parameters in appropriate start up plug and store it in context.

Best regards, Maksim Rashchynski.