# Created\_at timezone

**URL:** <https://discuss.dev.twitch.com/t/created-at-timezone/17961>\
**Category:** API\
**Created:** [September 29, 2018, 8:14am UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961 "2018-09-29T08:14:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottrc](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@scottrc](https://discuss.dev.twitch.com/u/scottrc)\
**Post date:** [September 29, 2018, 8:14am UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/1 "2018-09-29T08:14:58Z")

</div>

Hi, in the streams API endpoint there is the “created\_at” that gives for example 2018-09-29T06:42:53Z

What time zone is this in? I have no way to create a broadcast to test it. Thanks

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 29, 2018, 9:49am UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/2 "2018-09-29T09:49:20Z")

</div>

The timezone is `Z`

That timezone you gave as an example is formatted as per the RFC (I forget which) (Edit: @Dist says it is RFC3339 )

Z is +0 aka Zulu aka UTC

Another example would be:

> 2018-09-29T06:42:53+0100

Which would be +1 for the timezone

---

<div class="post-metadata">

**Author:** ![scottrc](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@scottrc](https://discuss.dev.twitch.com/u/scottrc)\
**Post date:** [September 29, 2018, 10:14am UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/3 "2018-09-29T10:14:10Z")

</div>

awesome thank you. Also does the API bring back different returns for the timezone for example 2018-09-29T06:42:53+0100 and a different stream might have 2018-09-29T06:42:53Z ?

Thanks

---

<div class="post-metadata">

**Author:** ![scottrc](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@scottrc](https://discuss.dev.twitch.com/u/scottrc)\
**Post date:** [September 29, 2018, 10:19am UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/4 "2018-09-29T10:19:57Z")

</div>

To make more sense, I’m trying to get the difference between the start time and current time in minutes or hours using Java.

---

<div class="post-metadata">

**Author:** ![Simbe](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/simbe/32/4527_2.png) [@Simbe](https://discuss.dev.twitch.com/u/Simbe)\
**Post date:** [September 29, 2018, 11:53am UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/5 "2018-09-29T11:53:49Z")

</div>

I don’t know what the “correct” way to do this would be but personally found it easiest to convert the date and time API gives to unix time stamp, then get current unix time, subtract the APIs time from current and then convert the result back to the format you need.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 29, 2018, 12:16pm UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/6 "2018-09-29T12:16:19Z")

</div>

Just take the time passed from the , pass it to a date time parser for your language and all done.

Thats the joy of this format:

> 2018-09-29T06:42:53Z

Left of T is the date in YYYY-MM-DD  
Right of T is HH:ii:ss  
Then a descriptor for the timezone

```
z/+0000 Zulu/UTC+0
+/-0100 for add/remove hours
+0030 in case you are in a wierd 30 minute zone, of thought it fun to return time weirdly

```

Basically, just take the time and dump it into a date time parser.

For java:

> <https://stackoverflow.com/questions/4216745/java-string-to-date-conversion>

Suggests that:

> new SimpleDateFormat()

Should accept the DateTime string passed by any API

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [October 29, 2018, 12:16pm UTC](https://discuss.dev.twitch.com/t/created-at-timezone/17961/7 "2018-10-29T12:16:20Z")

</div>

Closed on October 29, 2018, 12:16pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
