我正在尝试编写一个脚本来将数据推送到亚马逊 s3 存储桶,我需要生成我认为是 RFC 2822 日期以发送到标头请求中。
日期看起来像这样“2012 年 6 月 12 日星期二 23:41:58 +0000”
我只需要一个函数来生成正确的时间格式,因为我收到以下错误。
RequestTimeTooSkewed The difference between the request time and the current time is too large.
这是我目前所拥有的......
<%
sTimeStamp = "Tue, 12 June 2012 23:41:58 +00002012-06-12T22:45:47Z"
sAWSAccessKeyId = "AESDQWDQWD"
sSignature=Encrypt("SecretQWEQWEQWEQWEYAYAY")
AWSServiceUrl = "https://s3.amazonaws.com/"
Set oXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.open "GET", AWSServiceUrl, False
oXMLHTTP.setRequestHeader "Authorization", "AWS " & sAWSAccessKeyId & ":" & sSignature
oXMLHTTP.setRequestHeader "x-amz-date", sTimeStamp
on error resume next
oXMLHTTP.send sRequest
Response.Write oXMLHTTP.responseText
%>
有任何想法吗?