Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter - Time Zone of the Tweeet

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

like image 693
MNVR Avatar asked Dec 14 '10 19:12

MNVR


2 Answers

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.

like image 66
Liz Rice Avatar answered Sep 29 '22 08:09

Liz Rice


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();

like image 36
Ricky Smith Avatar answered Sep 29 '22 10:09

Ricky Smith