forked from indymedia/epicyon
timezone
parent
67bbf61d82
commit
823a390c16
|
@ -57,7 +57,6 @@ def updatePostSchedule(baseDir: str,handle: str,httpd,maxScheduledPosts: int) ->
|
||||||
if ' ' not in line:
|
if ' ' not in line:
|
||||||
continue
|
continue
|
||||||
dateStr=line.split(' ')[0]
|
dateStr=line.split(' ')[0]
|
||||||
print('DEBUG: schedule date='+dateStr)
|
|
||||||
if 'T' not in dateStr:
|
if 'T' not in dateStr:
|
||||||
continue
|
continue
|
||||||
postId=line.split(' ',1)[1].replace('\n','')
|
postId=line.split(' ',1)[1].replace('\n','')
|
||||||
|
@ -71,10 +70,9 @@ def updatePostSchedule(baseDir: str,handle: str,httpd,maxScheduledPosts: int) ->
|
||||||
# create the new index file
|
# create the new index file
|
||||||
indexLines.append(line)
|
indexLines.append(line)
|
||||||
# convert string date to int
|
# convert string date to int
|
||||||
if '+' in dateStr:
|
print('DEBUG: schedule date='+dateStr)
|
||||||
dateStr=dateStr.split('+')[0]+'Z'
|
|
||||||
postTime= \
|
postTime= \
|
||||||
datetime.datetime.strptime(dateStr,"%Y-%m-%dT%H:%M:%S%z")
|
datetime.datetime.strptime(dateStr,"%Y-%m-%dT%H:%M:%S%z").replace(tzinfo=None)
|
||||||
postDaysSinceEpoch= \
|
postDaysSinceEpoch= \
|
||||||
(postTime - datetime.datetime(1970,1,1)).days
|
(postTime - datetime.datetime(1970,1,1)).days
|
||||||
print('DEBUG: schedule postTime='+str(int(postTime)))
|
print('DEBUG: schedule postTime='+str(int(postTime)))
|
||||||
|
|
Loading…
Reference in New Issue