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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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