且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将字符串时间戳转换为日期

更新时间:2023-02-03 15:57:34

String ds = "Thu Jun 07 13:01:59 IST 2007";
SimpleDateFormat f = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
Date d = f.parse(ds);

正如其他人所说,答案在文档中。

As others mentioned, the answer is in the docs.