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
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Time Zone Issue?

[ Edited ]

"The format of the dates are different based on language.  "

Disagree.  Didn't we just demonstrate that a long value can be printed in a language independent manner. 

 

"format it as yyyy-DD-mm hh:mm:ss aaa "

So create a String, store it, and you have a consistent date, with no calculations or formatting required. 

 

"doing that I'm experiencing the timezone, dst issues"

Every issue that you have raised has been answered on this Thread. 

 

As I said, look at the method I gave you earlier.  If you don't think it works, test to demonstrate the problem and come back.  But if you can't demonstrate a problem with it, then it seems reasonable to use that approach doesn't it?

Trusted Contributor
KJake
Posts: 202
Registered: ‎11-21-2010
My Device: 9700

Re: Time Zone Issue?

Thanks Peter.  Where did we demonstrate that a long value can be printed in a language independant manner?

 

long someTime = HttpDateParser.parse("2010-04-17 08:49:37 ");

 

Doesn''t seem that I can load a long value into the .parse.  Would I need to parse out each piece of the long value to create the string that .parse can use?

 

Thanks a lot.

 

 

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

Re: Time Zone Issue?

1) "Where did we demonstrate that a long value can be printed in a language independant manner?"

Here:

http://supportforums.blackberry.com/t5/Java-Development/Time-Zone-Issue/m-p/1406661#M181264

 

2) "long someTime = HttpDateParser.parse("2010-04-17 08:49:37 ");"

That was just test data to prove the same date and time was used for both Languages.  I could, and probably should have suggested you use

 long someTime = 1271494177000L;

The result would have been the same. 

 

3) "Doesn''t seem that I can load a long value into the .parse"

Where did I suggest using Httpparser?

Here is what I recommended you do:

http://supportforums.blackberry.com/t5/Java-Development/Time-Zone-Issue/m-p/1406341#M181237

Step 3 converts the time to a String using SimpleDateFormat.. 

 

As mentioned before, all the answers are in this Thread.  I suggest you reread the posts and make sure you understand what we have been trying to tell you. 

Trusted Contributor
KJake
Posts: 202
Registered: ‎11-21-2010
My Device: 9700

Re: Time Zone Issue?

Thanks a lot everyone.  Been wrapped up in this for a couple days now and have just simply confused myself.  Will freread through the thread and get this working.  Thanks a lot, appreciate all the assistance.