Example #1
0
def datetime_to_epoch(dt):
    """ convert a datetime to seconds after (or possibly before) 1970-1-1 """
    if is_archaelogical():
        return bcdate_util.bcdate_to_epoch(dt)
    res = ((dt - datetime(1970, 1, 1)).total_seconds())
    return _cast_to_int_or_float(res)
Example #2
0
def datetime_to_epoch(dt):
    """ convert a datetime to seconds after (or possibly before) 1970-1-1 """
    if is_archaelogical():
        return bcdate_util.bcdate_to_epoch(dt)
    res = ((dt - datetime(1970, 1, 1)).total_seconds())
    return _cast_to_int_or_float(res)