Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
mindus
Posts: 104
Registered: 11-05-2009

Convert UTC string to date

Hi

 

  I have UTC date in string format. Can anybody know how to convert int date format.

 

If i use HttpDateParser its converted in to current date instead of UTC date.

 

String dateStr = "2012-02-23T06:29:23";

 

how to convert this dateStr to date.

 

 

Anyidea?

 

Thanks

mindus

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: Convert UTC string to date

parse it manually, using substrings.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Developer
mindus
Posts: 104
Registered: 11-05-2009

Re: Convert UTC string to date

Can u please give some sample or explain breifly

 

thanks

Please use plain text.
Developer
peter_strange
Posts: 14,611
Registered: 07-14-2008

Re: Convert UTC string to date

I'm betting it is correctly converted, but that you displaying the date using a function that converts to local time.  So it is the converting of the date to human visible form that you need to change, not the parsing.  Look at how you do this, and look at options to include Calendars with Time Zones settings or DateFields with TimeZone settings in your conversion. 

Please use plain text.