Example #1
0
File: time.py Project: 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
Example #2
0
 def _tonumber(self, d):
     """ Converts a date to a number """
     if d is None:
         return None
     return total_seconds(d - self._offset)
Example #3
0
def timedelta_to_seconds(x):
    if isinstance(x, timedelta):
        return total_seconds(x)
    return x