Broda Noel
Broda Noel

Reputation: 2026

Twitter API: How can I know the exactly hour a tweet was created?

I'm dealing with the Twitter API.

I need to know the hour exactly when the tweet was created. Meaning, the real locate hour where that guy was stand.

For example: If I create a tweet at 5PM Argentina Hour, I want to get "5PM" in the Twitter api.

The problem, is that the Twitter API always return the UTC hour, meaning, it's always "+0000". If I you don't know that I was in Argentina (-0300) in the moment I created the Tweet, you can't know that I tweeted at 5PM.

Absolutely all tweets are like this: Sun May 14 02:43:02 +0000 2017. All of those numbers always change (Day, Month, Day number, hour, minutes, seconds, year) BUT the +0000 never change.

For example, If my tweet (at 5PM) should be like: Sun May 14 17:00:00 -0300 2017 (because I'm in Argentina at 5PM: 17PM). But the API say: "Sun May 14 20:00:00 +0000 2017". (17 + 3).

I can't know where the tweet come from (because 99,9999% of the users has no GeoLocation enabled).

What can you say?

EDIT: I'm thinking that if Twitter give me that "-0300", twitter will be letting me know that I'm in Argentina, so, that will be movement against my provacity (and my no-geolocation-activated), so, makes sense that Twitter doesn't give us that information. But, anyways, I want to know what you say.

Upvotes: 0

Views: 246

Answers (1)

DWRoelands
DWRoelands

Reputation: 4940

The only way to know what the user's local time was when he created the tweet is to know where the user was when the tweet was created.

If the tweet does not have geolocation information, then you cannot easily know where the user was at that time without doing broader analysis.

About 2% of Tweets contain geolocation data (source), so that's a lot of tweets to work with.

Upvotes: 1

Related Questions