예제 #1
0
파일: time.py 프로젝트: sattel/pygal
def timedelta_to_seconds(x):
    """Convert a timedelta into an amount of seconds"""
    if isinstance(x, timedelta):
        return total_seconds(x)
    return x
예제 #2
0
 def _tonumber(self, d):
     """ Converts a date to a number """
     if d is None:
         return None
     return total_seconds(d - self._offset)
예제 #3
0
파일: time.py 프로젝트: young-0/pygal
def timedelta_to_seconds(x):
    if isinstance(x, timedelta):
        return total_seconds(x)
    return x