示例#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