# Path: src/bin/syndication_app/feedparser/datetimes/w3dtf.py
# def _parse_date_w3dtf(datestr):
#     if not datestr.strip():
#         return None
#     parts = datestr.lower().split('t')
#     if len(parts) == 1:
#         # This may be a date only, or may be an MSSQL-style date
#         parts = parts[0].split()
#         if len(parts) == 1:
#             # Treat this as a date only
#             parts.append('00:00:00z')
#     elif len(parts) > 2:
#         return None
#     date = parts[0].split('-', 2)
#     if not date or len(date[0]) != 4:
#         return None
#     # Ensure that `date` has 3 elements. Using '1' sets the default
#     # month to January and the default day to the 1st of the month.
#     date.extend(['1'] * (3 - len(date)))
#     try:
#         year, month, day = [int(i) for i in date]
#     except ValueError:
#         # `date` may have more than 3 elements or may contain
#         # non-integer strings.
#         return None
#     if parts[1].endswith('z'):
#         parts[1] = parts[1][:-1]
#         parts.append('z')
#     # Append the numeric timezone offset, if any, to parts.
#     # If this is an MSSQL-style date then parts[2] already contains
#     # the timezone information, so `append()` will not affect it.
#     # Add 1 to each value so that if `find()` returns -1 it will be
#     # treated as False.
#     loc = parts[1].find('-') + 1 or parts[1].find('+') + 1 or len(parts[1]) + 1
#     loc = loc - 1
#     parts.append(parts[1][loc:])
#     parts[1] = parts[1][:loc]
#     time = parts[1].split(':', 2)
#     # Ensure that time has 3 elements. Using '0' means that the
#     # minutes and seconds, if missing, will default to 0.
#     time.extend(['0'] * (3 - len(time)))
#     if parts[2][:1] in ('-', '+'):
#         try:
#             tzhour = int(parts[2][1:3])
#             tzmin = int(parts[2][4:])
#         except ValueError:
#             return None
#         if parts[2].startswith('-'):
#             tzhour = tzhour * -1
#             tzmin = tzmin * -1
#     else:
#         tzhour = timezonenames.get(parts[2], 0)
#         tzmin = 0
#     try:
#         hour, minute, second = [int(float(i)) for i in time]
#     except ValueError:
#         return None
#     # Create the datetime object and timezone delta objects
#     try:
#         stamp = datetime.datetime(year, month, day, hour, minute, second)
#     except ValueError:
#         return None
#     delta = datetime.timedelta(0, 0, 0, 0, tzmin, tzhour)
#     # Return the date and timestamp in a UTC 9-tuple
#     try:
#         return (stamp - delta).utctimetuple()
#     except (OverflowError, ValueError):
#         # IronPython throws ValueErrors instead of OverflowErrors
#         return None


import re
from .w3dtf import _parse_date_w3dtf
        return
    w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \
                {'year': m.group(1), 'month': m.group(2), 'day': m.group(3),\
                 'hour': m.group(4), 'minute': m.group(5), 'second': m.group(6),\
                 'zonediff': '+09:00'}
    return _parse_date_w3dtf(w3dtfdate)


def _parse_date_nate(dateString):
    """Parse a string according to the Nate 8-bit date format"""
    m = _korean_nate_date_re.match(dateString)
    if not m:
        return
    hour = int(m.group(5))
    ampm = m.group(4)
    if ampm == _korean_pm:
        hour += 12
    hour = str(hour)
    if len(hour) == 1:
        hour = '0' + hour
    w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \
                {
                    'year': m.group(1),
                    'month': m.group(2),
                    'day': m.group(3),
                    'hour': hour,
                    'minute': m.group(6),
                    'second': m.group(7),
                    'zonediff': '+09:00',
                }

# Path: src/bin/syndication_app/feedparser/datetimes/w3dtf.py
# def _parse_date_w3dtf(datestr):
#     if not datestr.strip():
#         return None
#     parts = datestr.lower().split('t')
#     if len(parts) == 1:
#         # This may be a date only, or may be an MSSQL-style date
#         parts = parts[0].split()
#         if len(parts) == 1:
#             # Treat this as a date only
#             parts.append('00:00:00z')
#     elif len(parts) > 2:
#         return None
#     date = parts[0].split('-', 2)
#     if not date or len(date[0]) != 4:
#         return None
#     # Ensure that `date` has 3 elements. Using '1' sets the default
#     # month to January and the default day to the 1st of the month.
#     date.extend(['1'] * (3 - len(date)))
#     try:
#         year, month, day = [int(i) for i in date]
#     except ValueError:
#         # `date` may have more than 3 elements or may contain
#         # non-integer strings.
#         return None
#     if parts[1].endswith('z'):
#         parts[1] = parts[1][:-1]
#         parts.append('z')
#     # Append the numeric timezone offset, if any, to parts.
#     # If this is an MSSQL-style date then parts[2] already contains
#     # the timezone information, so `append()` will not affect it.
#     # Add 1 to each value so that if `find()` returns -1 it will be
#     # treated as False.
#     loc = parts[1].find('-') + 1 or parts[1].find('+') + 1 or len(parts[1]) + 1
#     loc = loc - 1
#     parts.append(parts[1][loc:])
#     parts[1] = parts[1][:loc]
#     time = parts[1].split(':', 2)
#     # Ensure that time has 3 elements. Using '0' means that the
#     # minutes and seconds, if missing, will default to 0.
#     time.extend(['0'] * (3 - len(time)))
#     if parts[2][:1] in ('-', '+'):
#         try:
#             tzhour = int(parts[2][1:3])
#             tzmin = int(parts[2][4:])
#         except ValueError:
#             return None
#         if parts[2].startswith('-'):
#             tzhour = tzhour * -1
#             tzmin = tzmin * -1
#     else:
#         tzhour = timezonenames.get(parts[2], 0)
#         tzmin = 0
#     try:
#         hour, minute, second = [int(float(i)) for i in time]
#     except ValueError:
#         return None
#     # Create the datetime object and timezone delta objects
#     try:
#         stamp = datetime.datetime(year, month, day, hour, minute, second)
#     except ValueError:
#         return None
#     delta = datetime.timedelta(0, 0, 0, 0, tzmin, tzhour)
#     # Return the date and timestamp in a UTC 9-tuple
#     try:
#         return (stamp - delta).utctimetuple()
#     except (OverflowError, ValueError):
#         # IronPython throws ValueErrors instead of OverflowErrors
#         return None


# Path: src/bin/syndication_app/feedparser/datetimes/korean.py
import re
from .w3dtf import _parse_date_w3dtf

        return
    w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \
                {'year': m.group(1), 'month': m.group(2), 'day': m.group(3),\
                 'hour': m.group(4), 'minute': m.group(5), 'second': m.group(6),\
                 'zonediff': '+09:00'}
    return _parse_date_w3dtf(w3dtfdate)


def _parse_date_nate(dateString):
    """Parse a string according to the Nate 8-bit date format"""
    m = _korean_nate_date_re.match(dateString)
    if not m:
        return
    hour = int(m.group(5))
    ampm = m.group(4)
    if ampm == _korean_pm:
        hour += 12
    hour = str(hour)
    if len(hour) == 1:
        hour = '0' + hour
    w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \
                {
                    'year': m.group(1),
                    'month': m.group(2),
                    'day': m.group(3),
                    'hour': hour,
                    'minute': m.group(6),
                    'second': m.group(7),
                    'zonediff': '+09:00',
                }

    return _parse_date_w3dtf(w3dtfdate)