Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update date.py #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions suds/sax/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def __parse(self, s):
- YYYY-MM-DD(z|Z)
- YYYY-MM-DD+06:00
- YYYY-MM-DD-06:00
- YYYY-MM-DD-0600
Although, the TZ is ignored because it's meaningless
without the time, right?
@param s: A date string.
Expand Down Expand Up @@ -243,7 +244,7 @@ def __offset(self, s):
@return: The signed offset in hours.
@rtype: str
"""
if len(s) == len('-00:00'):
if len(s) == len('-00:00') or len(s) == len('-0000'):
return int(s[:3])
if len(s) == 0:
return self.tz.local
Expand Down Expand Up @@ -344,7 +345,7 @@ class Timezone:
@type patten: L{re.RegexObject}
"""

pattern = re.compile('([zZ])|([\-\+][0-9]{2}:[0-9]{2})')
pattern = re.compile('([zZ])|([\-\+][0-9]{2}:[0-9]{2})|([\-\+][0-9]{4})')

def __init__(self):
self.local = ( 0-time.timezone/60/60 )
Expand Down