From e9700efaacdc8ee28975d2544a62f7e07fe6769e Mon Sep 17 00:00:00 2001 From: VitoFe Date: Thu, 19 May 2022 21:32:47 +0200 Subject: [PATCH] Add timestamp_epoch field A lot of libraries work with POSIX timestamps, this makes it easier to work with those libraries without having to parse the dates multiple times. --- twint/tweet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/twint/tweet.py b/twint/tweet.py index c7adaa4d..b3806c30 100644 --- a/twint/tweet.py +++ b/twint/tweet.py @@ -85,6 +85,7 @@ def Tweet(tw, config): # parsing date to user-friendly format _dt = tw['created_at'] _dt = datetime.strptime(_dt, '%a %b %d %H:%M:%S %z %Y') + t.timestamp_epoch = datetime.timestamp(_dt) _dt = utc_to_local(_dt) t.datetime = str(_dt.strftime(Tweet_formats['datetime'])) # date is of the format year,