2012年8月27日星期一

amazon s3 signed url timezone problem

It's very simple to resolve it. Amazon s3 server is using GMT time. So you just need to use GMT time.

     Date date2 = new Date();                          //this is gmt time
     Calendar cal = Calendar.getInstance();
     cal.setTime(date2);
     cal.add(Calendar.SECOND, 120);           // after two minutes to expire
     Date newdate = cal.getTime();


TAG: amazon s3 signed url timezone problem

没有评论:

发表评论