开发者

Creating Date from string (EEST format problem)

I have problem converting from string to date.

The first one i Ok:

    Date d = new Date("Thu Jun 02 00:00:00 GMT+00:00 2011");

this one is fali(invalid argument):

    Date d1 = new Date("Mon Jun 06 00:00:00 EEST 2011");

Any suggestion? I need universal solution that will wor开发者_Python百科k with any format.


I think the next Q&A might solve your problem: Java - convert String (EEST included) into date

In short: you cannot use Date, but must use SimpleDateFormat.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜