I was asked to get the value of a key from a JSON on a particular website and subtract that value with
datetime.datetime.now - my key(epoch value)
You did say easiest. When a timestamp is involved think of the arrow library.
>>> time_string = '2017-08-14 11:52:09.145000' >>> import arrow >>> time_diff = arrow.now()-arrow.get(time_string) >>> time_diff.total_seconds() 17604.346025