How can I get the milliseconds of the unit of milliseconds courses GMT?

How can I design the following?

I need to get the milliseconds of the unit of milliseconds courses GMT.

I read the article 'compensation of time zone with DST' to http://supportforums.blackberry.com/t5/Java-Development/Get-time-zone-offsets-with-DST/ta-p/445189

I think I should start with system. currentTimeMillis () and get the GMT with or another of the following?

Is this a proper design?

Calendar rightnow = Calendar.getInstance(TimeZone.getDefault());

// With DST
int offsetDST = TimeZone.getDefault().getOffset(1, rightnow.get(Calendar.YEAR), rightnow.get(Calendar.MONTH), rightnow.get(Calendar.DAY_OF_MONTH), rightnow.get(Calendar.DAY_OF_WEEK), rightnow.get(Calendar.MILLISECOND));

// Without DST
int offset = TimeZone.getDefault().getRawOffset();

Make sure that your Simulator is configured to use the timezone right.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for