perl 日期处理:
[root@sword sbin]# cat a1.pl
use LWP::UserAgent;
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
use HTTP::Cookies;
use POSIX;
use Data::Dumper;
use JSON qw/encode_json decode_json/;
my $SDATE = strftime("%Y-%m-%dT%H:%M:%SZ",localtime());
use URI::Escape;
print $SDATE."
";
$SDATE=uri_escape("$SDATE");
print $SDATE."
";
[root@sword sbin]# perl a1.pl
2018-12-11T15:35:31Z
2018-12-11T15%3A35%3A31Z
python 日期处理:
import uuid
from urllib import unquote,quote
import time, datetime
a= uuid.uuid1()
now = datetime.datetime.now()
otherStyleTime = now.strftime("%Y-%m-%dT%H:%M:%SZ")
print otherStyleTime
print quote(otherStyleTime)
C:Python27python.exe C:/Users/TLCB/PycharmProjects/untitled/aliyun/y4.py
2018-12-11T15:41:23Z
2018-12-11T15%3A41%3A23Z