示例#1
0
    def convertDatetime(dt):
        # coerce timezones based on coerceTzinfo
        if coerceTzinfo is not None:
            dt = TimeZone.coerceTimeZone(view, dt, coerceTzinfo)

        # ... and make sure we return something with an ICUtzinfo
        return convertToICUtzinfo(view, dt)
示例#2
0
    def convertDatetime(dt):
        # coerce timezones based on coerceTzinfo
        if coerceTzinfo is not None:
            dt = TimeZone.coerceTimeZone(view, dt, coerceTzinfo)

        # ... and make sure we return something with an ICUtzinfo
        return convertToICUtzinfo(view, dt)
示例#3
0
def makeNaiveteMatch(view, dt, tzinfo):
    if dt.tzinfo is None:
        if tzinfo is not None:
            dt = TimeZone.coerceTimeZone(view, dt, tzinfo)
    else:
        if tzinfo is None:
            dt = TimeZone.stripTimeZone(view, dt)
    return dt
示例#4
0
def makeNaiveteMatch(view, dt, tzinfo):
    if dt.tzinfo is None:
        if tzinfo is not None:
            dt = TimeZone.coerceTimeZone(view, dt, tzinfo)
    else:
        if tzinfo is None:
            dt = TimeZone.stripTimeZone(view, dt)
    return dt