netbeansjava-meemulationjava-wireless-toolkit

change sun wtk J2ME emulator system time from UTC to host local time


I am working on a J2ME midlet project. I am using Sun WTK 2.5.2_01. The problem is that the time on the emulator device is UTC but i need it to be my host machines local time. I tried to find a setting in the wtk preferences to no avail.

Is this behaviour normal? can I change it? or how can I work around it?


Solution

  • I've had this problem myself for ages and I finally figured out a workaround. WTK has a settings file system.config in its lib directory. From there you should find a property: "com.sun.cldc.util.j2me.TimeZoneImpl.timezone"

    It was commented away in my file and here you can set which time zone WTK uses. For me setting it as "GMT+03:00" worked. However, I suspect that the setting needs to be changed every time summer or winter time begins.