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
Posts: 144
Registered: ‎12-20-2008
My Device: Not Specified

long variable time to fomat string day etc

i store in a variable like _dateNow = System.currentTimeMillis();

how when rade from datbase i can convert this value to format Saturday 17/01/2009 17:05:14 PM

 

thanks

r.soler

Highlighted
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: long variable time to fomat string day etc

Create a SimpleDateFormat object with a format string.

 

The you pass your long value to the method SimpleDateFormat.formatLocal()

 

A format string might look something like: "E dd MMM yyyy HH:mm". (see the API docs for SimpleDateFormat).