views:

133

answers:

1

Hi everyone!

I have a date string as input from an rss like: Wed, 23 Dec 2009 13:30:14 GMT

I want to fetch only the time-part, but it should be correct according to the my timezone. Ie, in Sweden the output should be: 14:30:14

What is the best way? I want it to work with other RSS date formats as well if possible. Im using regexp right now but that is not very general.

Im having a hard time finding any library or support for dates and timezones in j2me?

/Br Johannes

A: 

In normal Java, I'd use a SimpleDateFormat object (that you create to match the pattern of the date you're getting in the RSS) to parse the String value and give you a Date object. Then, using a Calendar (which would be localized to your time zone), you'd be able to get the hour, minute, and second information.

I don't know j2me, but a google search suggests that these classes are available in j2me.

Matt
Hi! I have googled a lot about similar problems and I just see answers telling me to implement something myself. The SimpleDateFormat is sadly not included in j2me.Im a little suprised that there seems to be no solution even though j2me is so mature?
joynes