10-08-2013 04:53 AM
I am having one Date Time format like "2013-10-09T12:45:00+05:30". How can i convert it into "HH:MM a" or "hh:mm a" into my Blackberry Java Application.
Thanks and Best Regards.
Solved! Go to Solution.
10-08-2013 04:58 AM
the only dateparser is HttpDateParser, which is quite peculiar in the formats it takes. If your date adheres to the restriction you can use it, otherwise you would have to parse it yourself with substring and calendar.
to get the target formatting you can use SimpleDateFormat.
10-08-2013 06:38 AM
long millis = System.currentTimeMillis(); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm a"); String currentTime = sdf.format(new Date(millis));
Hit Like if you found this Your Solution
10-08-2013 07:39 AM - edited 10-08-2013 07:40 AM
First of all Thanks for replying, Aman.
from the post it seems that your code is taking current time as input.. But friend i need to convert any time taken as input in the format like "2013-10-09T12:45:00+05:30" . I want to extract 12:45 PM from this type of input. Please help me out of it.
I can parse it manually..but i want to know if there is any inbuilt technique...
Waiting for the reply