我在试着打电话:
https://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester
&AWSAccessKeyId=[the Requester's Access Key ID]
&Version=2012-03-25
&Operation=ApproveRejectedAssignment
&Signature=[signature for this request]
&Timestamp=[your system's local time]
&AssignmentId=123RVWYBAZW00EXAMPLE456RVWYBAZW00EXAMPLE我需要签名,它需要像2012-05-25T11:30:47-07:00这样的YYYY:dd:MMTHH:mm:ss-Offset格式的UTC时间戳
我正在尝试使用here提供的java工具来制作签名,但是我无法获得正确格式化的日期。
我也在尝试使用SDK,但是我不知道从哪里开始。
发布于 2012-06-23 15:09:12
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
Date date = new Date(System.currentTimeMillis());
System.out.println(sdf.format(date)); // 2012-06-23T00:03:52-0700发布于 2012-06-23 10:03:48
SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dateFormatGmt.setTimeZone(TimeZone.getTimeZone("GMT"));
//Local time zone
SimpleDateFormat dateFormatLocal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//Time in GMT
String[] datetime = dateFormatGmt.format(new Date()).split(" ");
String date = datetime[0];
String time = datetime[1];
System.out.print(date+"T"+time+"Z");https://stackoverflow.com/questions/10759721
复制相似问题