java dates conversion with 00:00:00.000

Viewed 6131

I have date strings in this format:

2011/02/14 00:00:00.000 -0800

I convert it to java Date object in the following way:

this.pubDate = Date.parse("yyyy/MM/dd 00:00:00.000 Z", obj.SourcePublishedDate);

The above produces result 2011/02/14 00:00:00.000 +0000 I have two questions about the result. With parsing 0 time as it is, I'm using format "yyyy/MM/dd 00:00:00.000 Z". Is there a better way to do that, maintaining the 0s? The second question is about the timezone, for some reason I'm getting back +0000 instead of -0800. How could parse the right value? Much appreciate your time.

2 Answers
Related