def excel_datetime ( timestamp , epoch = None ) : if epoch is None : epoch = datetime . datetime . fromordinal ( 693594 ) return epoch + datetime . timedelta ( timestamp )
datetime to excel timestamp python3
Return datetime object from timestamp in Excel serial format .
def excel_datetime(timestamp, epoch=None):
    """Return datetime object from timestamp in Excel serial format.

    Convert LSM time stamps.

    >>> excel_datetime(40237.029999999795)
    datetime.datetime(2010, 2, 28, 0, 43, 11, 999982)

    """
    if epoch is None:
        epoch = datetime.datetime.fromordinal(693594)
    return epoch + datetime.timedelta(timestamp)