Twitter - Time Zone of the Tweeet
Asked Answered
S

4

7

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

Serge answered 14/12, 2010 at 19:17 Comment(0)
P
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();

Pentup answered 23/1, 2011 at 5:16 Comment(3)
Thank you Rick. This is useful.Serge
Note that these days, the REST API returns created_at in UTCParental
I believe that's always been the case. It is .NET that converts the date to local time.Pentup
D
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.

Ditto answered 27/4, 2012 at 14:38 Comment(0)
P
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();

Pentup answered 23/1, 2011 at 5:16 Comment(3)
Thank you Rick. This is useful.Serge
Note that these days, the REST API returns created_at in UTCParental
I believe that's always been the case. It is .NET that converts the date to local time.Pentup
H
0

Time zone is in the user settings under delivery options.

Hobo answered 14/12, 2010 at 19:25 Comment(0)
E
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.

Eighteen answered 14/5, 2021 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.