开发者

How to convert complex date string into datetime java

I have the following string that I need put into a date time

Sat, 21-May-2011 21:31:35 GMT

So far I'm d开发者_开发百科oing the following but I'm not sure of the valid format to get this parsed. Any help would be appreciated!

SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Date date = df.parse("Sat, 21-May-2011 21:31:35 GMT");

Thank you in advance


See documentation for SimpleDateFormat for format guidence You should have something like this

SimpleDateFormat df = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss zzz");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜