|
import os,string,time
def GetNextYMD(sYMD,iDay):
tt = (int(sYMD[0:4]),int(sYMD[4:6]),int(sYMD[6:8]),0,0,0,0,1,0);
print tt
s = time.strftime("%Y%m%d",time.localtime(time.mktime(tt)+(iDay*24*60*60)))
return s
def main():
s1="20030914"
print s1,"before"
GetNextYMD(s1,1);
print s1,"after"
return 1
if __name__=="__main__":
main()
我预期的运行结果是20030915,结果输出还是20030914,改为2004年也一样,错在哪里了?莫非time族的函数有问题? |
|