1f6ca41 handle Y2038 in timestamp to datetime conversions

Authored and Committed by abbra 3 years ago
    handle Y2038 in timestamp to datetime conversions
    
    According to datetime.utcfromtimestamp() method documentation[1],
    this and similar methods fail for dates past 2038 and can be replaced by
    the following expression on the POSIX compliant systems:
    
      datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)
    
    Make sure to use a method that at least allows to import the timestamps
    properly to datetime objects on 32-bit platforms.
    
    [1] https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp
    
    Fixes: https://pagure.io/freeipa/issue/8378
    
    Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
    Reviewed-By: Rob Crittenden <rcritten@redhat.com>
    Reviewed-By: Christian Heimes <cheimes@redhat.com>
    
        
file modified
+6 -3
file modified
+24 -0
file modified
+4 -2
file modified
+4 -2
file modified
+4 -3