如何获得黑莓从编程的的DateField日期和时间值? [英] How to get the Date and time value from DateField in Blackberry Programming?
问题描述
我使用的DateField,以显示我的黑莓计划的日期和时间,如果用户改变应该在database.But DateField组件作为一个long返回值更新的日期,我不能用这漫长的价值做任何事。如果任何人知道如何获得日期和时间值的字符串,请帮助我。
I am using DateField to display the Date and Time in my Blackberry Program,if the user changes the date it should be updated in the database.But the DateField component returns as a long value, i cannot do anything with this long value.If anyone knows how to get the Date and Time value as String please help me.
推荐答案
net.rim.device.api.i18n.SimpleDateFormat
将让你轻松格式化长日期/时间到你想要的任何字符串日期/时间。
net.rim.device.api.i18n.SimpleDateFormat
will let you easily format a long date/time into any String Date/Time you want.
如果你想只得到长日期/时间为单个数值的各个组件,使用 java.util.Calendar中的
If you want to just get the individual components of the long date/time as individual numeric values, use java.util.Calendar
这篇关于如何获得黑莓从编程的的DateField日期和时间值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!