コード例 #1
0
ファイル: dateutil.py プロジェクト: mpm2050/Raven
def createSchemaDateTime(year, month, day, hour, min, secs, localTz = True):
    if localTz:
        tz = ZLocalTimezone()
    else:
        tz = UTC_TIMEZONE
    dt = createDateTime(year, month, day, hour, min, secs, tz)
    return ZSchemaDateTime(dt)
コード例 #2
0
ファイル: dateutil.py プロジェクト: mpm2050/Raven
def getIso8601Date(dateString):
    if not dateString:
        return None
    # check GMT time match YYYYMMDD:HHMMZ sent by some xml-rpc servers (wordpress 2.2+)
    m = re.match(XMLRPC_UTC_DATE_PATTERN, dateString)
    if m:
        (year, month, day, h, m, s) = m.groups()
        return ZSchemaDateTime(createDateTime(int(year), int(month), int(day), int(h), int(m), int(s), UTC_TIMEZONE))
    
    # check local time match YYYYMMDD:HHMM sent by some xml-rpc servers.
    m = re.match(XMLRPC_LOCAL_DATE_PATTERN, dateString)
    if m:
        (year, month, day, h, m, s) = m.groups()
        return ZSchemaDateTime(createDateTime(int(year), int(month), int(day), int(h), int(m), int(s), ZLocalTimezone()))
    else:
        return ZSchemaDateTime(dateString)
コード例 #3
0
ファイル: schematypes.py プロジェクト: mpm2050/Raven
 def _initFromYYYYMMDDHHMMSS(self,
                             year,
                             month,
                             day,
                             hour,
                             minute,
                             second,
                             tz=UTC_TIMEZONE):
     # Note: not sure about the millis param...
     dt = createDateTime(year, month, day, hour, minute, second, tz)
     self.dateTime = convertToUtcDateTime(dt)
コード例 #4
0
ファイル: daterange.py プロジェクト: mpm2050/Raven
def createStartDate(year, month, day):
    return createDateTime(year, month, day, 0, 0, 0, ZLocalTimezone())
コード例 #5
0
ファイル: daterange.py プロジェクト: mpm2050/Raven
def createEndDate(year, month, day):
    return createDateTime(year, month, day, 23, 59, 59, ZLocalTimezone())
コード例 #6
0
ファイル: daterange.py プロジェクト: Tidosho/zoundryraven
def createStartDate(year, month, day):
    return createDateTime(year, month, day, 0, 0, 0, ZLocalTimezone())
コード例 #7
0
ファイル: daterange.py プロジェクト: Tidosho/zoundryraven
def createEndDate(year, month, day):
    return createDateTime(year, month, day, 23, 59, 59, ZLocalTimezone())
コード例 #8
0
ファイル: schematypes.py プロジェクト: Tidosho/zoundryraven
 def _initFromYYYYMMDDHHMMSS(self, year, month, day, hour, minute, second, tz = UTC_TIMEZONE):
     # Note: not sure about the millis param...
     dt = createDateTime(year, month, day, hour, minute, second, tz)
     self.dateTime = convertToUtcDateTime(dt)