on 02-01-2007 5:17 PM
Im developping a mobile application where the mobile devices and the SAP server are in a different timezone. I have tried a couple of things to do that but nothing seems to work..
We are using:
CrEme J2ME(tm)
CrEme V3.25 (=> Personal Java 3.1)
Mobile Engine version: ME 2.1 SP 03 Patch 00 Build 200403030929
I know this is rather old, but this is only a port of an existing application so I would rather not change the setup.
In the business object we have:
public void setSddat(Calendar sddat);
This was called in the originally application like this:
zitm004.setSddat(new GregorianCalendar());
Now with different timezones i have tryed to change the timezone of the GregorianCalendar().
TimeZone tz = TimeZone.getTimeZone("ECT");
Calendar calendar = new GregorianCalendar();
calendar2.setTimeZone(tz);
zitm004.setSddat(calendar);
This is not working. However following code showed me the right time:
TimeZone tz = TimeZone.getTimeZone("ECT");
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.setTimeZone(tz);
Log.log(Log.DEVELOP_LEVEL,"sdf.format(now):" + sdf.format(now));
I also tried setting the timezone in MobileEngine.conf using:
MobileEngine.Sync.Timezone=ECT or
MobileEngine.Sync.Timezone=Europe/Brussels
This is not working, and i think my mobile engine does not support this setting yet as i dont see anything about timezone appearing in the trace.
Any ideas?
Thanks,
Hannes
hi hannes,
can you try using:
Calendar.getInstance(TimeZone.getTimeZone("ECT"));
or try adding
calendar.setTimeZone(tz);
calendar.getTime(); //<<--- added line
zitm004.setSddat(calendar);
i remember there was a bug in the Calendar implementation in the early JDK1.1
which is the base of Personal Java. (something related to the setTimeZone method
that doesn't do the recalculation until the getTime method is invoked.)
not sure if it works but might worth a try.
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.