# Timex Oddity

**URL:** <https://forum.elixirforum.com/t/timex-oddity/45386>\
**Category:** Questions\
**Tags:** timex\
**Created:** [January 20, 2022, 3:08pm UTC](https://forum.elixirforum.com/t/timex-oddity/45386 "2022-01-20T15:08:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Onor.io](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/onor.io/32/960_2.png) [@Onor.io](https://forum.elixirforum.com/u/Onor.io)\
**Post date:** [January 20, 2022, 3:08pm UTC](https://forum.elixirforum.com/t/timex-oddity/45386/1 "2022-01-20T15:08:02Z")

</div>

A colleague spotted an odd thing that neither of us can figure out:

iex(1)\> Timex.timezone(“America/Chicago”, {2015,4,12})

#\<TimezoneInfo(America/Chicago - CDT (-05:00:00))\>

iex(2)\> Timex.timezone(“America/Chicago”, {2015,1,12})

#\<TimezoneInfo(America/Chicago - CST (-06:00:00))\>

I would have expected _all_ calls to timezone in Chicago to be -06:00:00. Is the difference due to Daylight Savings Time or something else?

---

<div class="post-metadata">

**Author:** ![jerdew](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jerdew/32/18541_2.png) [@jerdew](https://forum.elixirforum.com/u/jerdew)\
**Post date:** [January 20, 2022, 3:39pm UTC](https://forum.elixirforum.com/t/timex-oddity/45386/2 "2022-01-20T15:39:04Z")

</div>

DST is probably the cause, but it could possibly be weirder things .. timezones are strange. you can set the timezone to a variable, and then examine its properties to see its local offset (offset\_std) and when that offset is valid from/until:

```elixir
iex> tz = Timex.timezone("America/Chicago", {2015,4,12})
iex> tz.offset_std
3600
iex> z = Timex.timezone("America/Chicago", {2015,1,12})
iex> tz.offset_std
0
iex> tz.from 
{:sunday, {{2014, 11, 2}, {1, 0, 0}}}
iex> tz.until                                           
{:sunday, {{2015, 3, 8}, {2, 0, 0}}}

```

---

<div class="post-metadata">

**Author:** ![Onor.io](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/onor.io/32/960_2.png) [@Onor.io](https://forum.elixirforum.com/u/Onor.io)\
**Post date:** [January 20, 2022, 4:16pm UTC](https://forum.elixirforum.com/t/timex-oddity/45386/3 "2022-01-20T16:16:52Z")

</div>

Yeah that sure looks like it’s Daylight Savings Time. Thanks for the reply @jerdew!
