Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
08-12-2008 05:43 AM
I have been looking for best practise to convert "tim" (Java statement below) in milli-seconds (since 1970 midnight) to human readable Date & Time.
I know roughly about SimpleDateFormat() but not sure how to implement it.
If anyone knows or can provide a sample code that will be great.
String tim = Long.toString(l.getTimestamp()); // timestamp
Thanks in advance
Solved! Go to Solution.
08-12-2008 08:49 AM
08-12-2008 09:43 PM
Many Thanks for your reply.
I tried to use the above lines of code as it is and got few errors.
java:49: cannot find symbol
symbol : class SimpleDateFormat
location : class ................
I also used
But I am still getting error. Pardon me for my inexpertese with Java.
08-12-2008 10:49 PM - edited 08-13-2008 12:27 PM
Let me ask seriously: Do you program w/o using the Javadocs? I can't even tie my shoes without looking at the Javadocs first - they're indispensable. If you open the Javadocs and browse through the alphabetical list of classes you'll find SimpleDateFormat in net.rim.device.api.i18n (Format isn't a package, it's a class so you shouldn't be trying to do a wildcard import with it).
Even better, if you use Eclipse you can put your cursor on the SimpleDateFormat word and hit ctrl-shift-m and it will add the import for you. In NetBeans do ctrl-shift-i.
08-12-2008 11:28 PM
Sorry Richard, for not doing my homework. I did have a look at the java docs and with my limited knowledge in Java I did have
But after looking at your reply I removed (.*) at the end of my import. Since all the imports in my code had .* at the end I assumed that as a syntax which wasnt true.
My Sincere Thanks!
08-13-2008 03:15 AM
if you use Eclipse you can put your cursor on the SimpleDateFormat word and hit ctrl-shift-m and it will add the import for you.
08-13-2008 05:15 AM