How to parse Date from HTTP Last-Modified header?

前端 未结 5 2000
孤街浪徒
孤街浪徒 2020-12-08 00:02

HTTP Last-Modified header contains date in following format (example):
Wed, 09 Apr 2008 23:55:38 GMT
What is the easiest way to parse java.util.

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 00:34

    If you're using URLConnections, there is already a handy method.

    See URLConnection#getLastModified

    This method parses the date string and returns a milliseconds value. Then you can happily create a Date with that value.

提交回复
热议问题