prepare fault-tolerant date parsing (not used at the moment
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@4027 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
1f513ca146
commit
5dacf19a5d
1 changed files with 9 additions and 1 deletions
|
@ -129,7 +129,15 @@ class OfficeFile(ExternalFileAdapter):
|
|||
def parseDate(s):
|
||||
if not s:
|
||||
return None
|
||||
dt = datetime(*strptime(s, '%Y-%m-%dT%H:%M:%SZ')[:6]) + timedelta(hours=2)
|
||||
tt = strptime(s, '%Y-%m-%dT%H:%M:%SZ')
|
||||
#try:
|
||||
# tt = strptime(s, '%Y-%m-%dT%H:%M:%SZ')
|
||||
#except ValueError:
|
||||
# try:
|
||||
# tt = strptime(s, '%d.%m.%y')
|
||||
# except ValueError:
|
||||
# tt = strptime(s, '%d.%m.%Y')
|
||||
dt = datetime(*tt[:6]) + timedelta(hours=2)
|
||||
return date(dt.year, dt.month, dt.day)
|
||||
#return date(*strptime(s, '%Y-%m-%dT%H:%M:%SZ')[:3])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue