How to show DateField with AM/PM format in blackberry?
-
22-07-2019 - |
Question
I don't know how to show Time in AM/PM format in blackberry using blackberry datefield.Pls give me a idea how to do this.
Solution
Use SimpleDateFormat:
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss aa");
long date = System.currentTimeMillis();
DateField dateField = new DateField("time:", date, timeFormat);
add(dateField);
alt text http://img171.imageshack.us/img171/7642/timeformat.jpg
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow