I was asked to get the value of a key from a JSON on a particular website and subtract that value with .now
(it's an expiration date).
I'm doing it using a requests.get
as well as a json.load
. My problem is: The value that I'm getting is epoch time and datetime.datetime.now
is not.
What's the easiest way to (datetime.datetime.now - my key(epoch value)
)? See values in screenshot below. I've tried converting from epoch to "human date" then do a subtraction with it but nope.
EDIT: This may not be a duplicate because it asks about processing a timestamp and wants number of seconds between that timestamp and now.