7

What is the time zone used for tweets in Twitter API?

MNVR
  • 865
  • 4
  • 16
  • 30

4 Answers4

7

The created_at field for a tweet in the Twitter REST API gives the timestamp in UTC.

If a user has configured their timezone with Twitter, the utc_offset field gives you the difference in seconds between their timezone and UTC. So,

"utc_offset":-28800

corresponds to -28800/3600 = -8 hours from UTC.

There are a couple of suggestions that this doesn't get adjusted for daylight savings.

Liz Rice
  • 589
  • 6
  • 9
6

The timezone of each tweet is automatically converted to the local timezone. If you need UTC, you can use the .ToUniversalTime() method, for example:
myTweet.CreatedDate.ToUniversalTime();

Ricky Smith
  • 2,379
  • 1
  • 13
  • 29
0

Time zone is in the user settings under delivery options.

iivel
  • 2,576
  • 22
  • 19
0

Unfortunately, I think It is impossible. Twitter does not store any information related to local timezone. I found that user.utc_offset are always null.

Slef Ved
  • 51
  • 1
  • 6