开发者

How to show DateField with AM/PM format in blackberry?

开发者 https://www.devze.com 2022-12-09 16:56 出处:网络
I don\'t know how to show Time in AM/PM f开发者_C百科ormat in blackberry using blackberry datefield.Pls give me a idea how to do this.Use SimpleDateFormat:

I don't know how to show Time in AM/PM f开发者_C百科ormat in blackberry using blackberry datefield.Pls give me a idea how to do this.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消