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

New Contributor
Posts: 6
Registered: ‎10-17-2011
My Device: 9700
My Carrier: Vodophone

Converting Date Format

Hi All,


I'm a newbie to Blackberry App Java Development. Could someone help me with some sample code to covert a date and time format.


Links to blackberry documentation is also fine.


Kindly help friends.

Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Converting Date Format

welcome to the support forums.

you can use http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/i18n/DateFormat.html and its subclass http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/i18n/SimpleDateFormat.html to format a date.

from string to date you can use http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/io/http/HttpDateParser.html but be aware that it requires certain formats, in other cases you might want to parse the date manually with the help of a calendar instance.
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.
@SimonHain on twitter