Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 2
Registered: ‎02-23-2011
My Device: Not Specified
Accepted Solution

Differences in the date shown by DateField

Hello!

 

I´m experiencing strange behavior while working with the DateField control on different OS versions. When using this declaration

 

DateField testField = new DateField("", 0, DateFormat.getInstance(DateFormat.TIME_SHORT), DrawStyle.RIGHT);

 

on a 9000 simulator, the DateField shows the correct time, 00:00

But on a 9800 simulator, the date is 19:00

The JRE System Library used to write my application is 4.7.0

Respectivley, it behaves the same with different long-values. 04:30 on the 9000 is 23:30 on the 9800.

Does anyone know a solution or workaround for this?

 

Thanks in advance,

Luke.

Developer
Posts: 131
Registered: ‎08-13-2008
My Device: Not Specified

Re: Differences in the date shown by DateField

If you pay attention to the differences in time, the two simulators are always 19 hours apart. The way I see it, they could simply have different time zone settings.

New Contributor
Posts: 2
Registered: ‎02-23-2011
My Device: Not Specified

Re: Differences in the date shown by DateField

Hi!

 

Thank you for your reply, it was just as you said. The timezone on the 9000 is GMT and on the 9800 America/New York. Just setting the TimeZone to GMT after initialising the DateField does the trick.

 

Thanks again,

Luke

Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: Differences in the date shown by DateField

Welcome to the forum LukeBB.

 

If this is solved, can I ask you to mark the Thread as such.  The Help (see link at the top of the screen) might be helpful for this and other questions you might have on using the forum.

 

Cheers and look forward to seeing you around.