cancel
Showing results for 
Search instead for 
Did you mean: 

Java Calendar.ZONE_OFFSET method does not return correct Zone Offset

Former Member
0 Kudos

HI,

We are upgrading from ME to MI - but we are keeping the same Java application. We have e functionality where the time on the device is updated to the time recived from the server. We do get the correct time from the function module that sends this time, but the following line of code that is supposed to calculate the zone offset does not return the correct offset (we are GMT+2).

hours = hours - (Calendar.getInstance().get(Calendar.ZONE_OFFSET )/3600000);

I recive a value 0 or 1 for "hours". WHY IS IT NOT RETURNING 2??

Any advice?

tks

Christiaan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The MI Client "converts" the Timezone of the Mobile Device in terms of a Timezone of its own frame of references. For example, in my case the Mobile COmponents Timezone of GMT2 was converted into a "ART" timezone. After communicating with Mobile support at SAP HO, I was informed that "ART" is the MI's "version" of GMT2

Former Member
0 Kudos

Hello

try this one, AFAIK you need to include the DST offset to

System.out.println ((Calendar.getInstance().get(Calendar.ZONE_OFFSET )/3600000) + Calendar.getInstance().get(Calendar.DST_OFFSET)/3600000);

reagards franz

reward points if useful