Java – Common format for time zone in Java/J2me


We are developing a j2me app for syncing contacts to/from a server. we are storing the update and create time (long mill sec) with each contact for conflict resolution/sync calculations.

Now as the client and server app can be in different time zones , how one can store time with time zone in a standard format (to take care diff time zones and daylight savings) for calculations at client and server side.

Best Solution

If you use System.currentTimeMillis() you don't have to worry about time zones, because it is in universal time. From System.currentTimeMillis() Javadoc:

public static long currentTimeMillis()


Returns: the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

The time zone UTC is Coordinated Universal Time, which is mostly GMT .