My problem lies in parsing a custom date string in BlackBerry Java. Java SE provides the class SimpleDateFormat which has the ability to parse a String against a given pattern/format.
However, in BlackBerry the SimpleDateFormat class does not contain the method to parse, only format a date into the desired pattern.
I am aware of HttpDateFormatter which can parse a String, however, it is a strict parser that will only work with three date formats that HTTP has used in the past:
I will be parsing date strings coming from the Twitter API in the format:
Before going away and writing my own error prone date parse, is there any other routes I could investigate?
Regards,
Thomas Nadin
Yes, as of 7.1, there is no method to parse with a custom format in BB Java API. You should implement your own. I did it long ago using Calendar
, with the same format as the Java SE API.
Before doing your own one, have a look at OpenSource projects like Joda, Guava or OpenJDK, maybe you can find some "inspiration" there.
Good luck.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.