I have date in this format 2011-11-02. From this date, how can we know the Day-of-week, Month and Day-of-month, like in this format Wednesday-Nov-02, from calendar or any other way?
I have date in this format 2011-11-02 . From this date, how can we
Share
If it were normal java, you would use two SimpleDateFormats – one to read and one to write:
Output:
As a function (ie static method) it would look like:
Warning:
Do not be tempted to make
readorwriteinto static fields to save instantiating them every method invocation, because SimpleDateFormat is not thread safe!Edited
However, after consulting the Blackberry Java 5.0 API doc, it seems the
write.formatpart should work with blackberry’s SimpleDateFormat, but you’ll need to parse the date using something else… HttpDateParser looks promising. I don’t have that JDK installed, but try this: