mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
GMT Time in ATOM feeds
This commit is contained in:
parent
4a6bf81b2e
commit
acb65b77af
2 changed files with 11 additions and 2 deletions
|
|
@ -2,6 +2,8 @@
|
|||
import re
|
||||
import os
|
||||
import shutil
|
||||
import time
|
||||
import calendar
|
||||
from datetime import datetime
|
||||
from codecs import open as _open
|
||||
from itertools import groupby
|
||||
|
|
@ -222,3 +224,10 @@ def files_changed(path, extensions):
|
|||
LAST_MTIME = mtime
|
||||
return True
|
||||
return False
|
||||
|
||||
def local_to_utc(t):
|
||||
"Convert article time to UTC time for ATOM feeds"
|
||||
secs = time.mktime(t)
|
||||
gmtime = list(time.gmtime(secs))
|
||||
gmtime[8] = 1
|
||||
return datetime.fromtimestamp(time.mktime(gmtime))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue