Closed Rich-Hopkins closed 4 years ago
Is there a way that you would recommend for comparing datetimes? For example, I want to know if a timestamp received from an API is more than 2 hours prior to current time. Both times would be in UTC so timezone and DST conversion is not necessary.
Eh... Simply get the times in seconds since epoch and see if they're more or less than 7200 seconds apart?
Rop
Umm... Yeah. Thanks.
Is there a way that you would recommend for comparing datetimes? For example, I want to know if a timestamp received from an API is more than 2 hours prior to current time. Both times would be in UTC so timezone and DST conversion is not necessary.