API文档“Date”字段

最近更新时间:2019-09-26 18:32:25

API文档“Date”字段的GMT格式说明

使用到 “DATE” 表示时间的字段,必须为HTTP1.1中支持的三种GMT格式时间,用户仅需提供三种格式中的任意一种即可。详细的说明请参考:HTTP1.1协议说明。三种格式为:

HTTP-date = rfc1123-date | rfc850-date | asctime_date

格式一

rfc1123-date = wkday "," SP day(2) SP month SP year(4) SP time SP "GMT"

括号中数字表示位数,示例:Thu, 26 Sep 2018 15:30:26 GMT

格式二

rfc850-date = weekday "," SP day(2) "-" month "-" year(2) SP time SP "GMT"

括号中数字表示位数,示例:Thursday, 26-Sep-18 15:30:26 GMT

格式三

asctime-date = wkday SP month SP day(2 | SP 1) SP time SP year(4)

注意:日期没有前导零,需空格占位。

括号中数字表示位数,示例:Thu Sep  8 15:30:26 2018

各字段解释

  • SP表示空格
  • time = hh(2) ":" mm(2) ":" ss(2),取值:00:00:00 - 23:59:59
  • wkday = "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"
  • weekday = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday"
  • month = "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"

金山云,开启您的云计算之旅

注册有礼