# \#timex

**URL:** https://forum.elixirforum.com/tag/timex/522.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Timex.from\_now() How to update liveview every second or more optimized way, to display x seconds ago?](https://forum.elixirforum.com/t/timex-from-now-how-to-update-liveview-every-second-or-more-optimized-way-to-display-x-seconds-ago/72516)

<div class="topic-metadata">

**Author:** [@water](https://forum.elixirforum.com/u/water)\
**Replies:** 4\
**Last updated:** [September 20, 2025, 8:41pm UTC](https://forum.elixirforum.com/t/timex-from-now-how-to-update-liveview-every-second-or-more-optimized-way-to-display-x-seconds-ago/72516 "2025-09-20T20:41:56Z")

</div>

Timex’s from\_now gives the relative duration from now. But I’d like to show it in real time. The x seconds ago would count up every second. The minutes every minute, and so on. Is there a better way to do this than jus…

---

## [Need help understanding Timex, date structures, converting timezones, local presentation](https://forum.elixirforum.com/t/need-help-understanding-timex-date-structures-converting-timezones-local-presentation/72208)

<div class="topic-metadata">

**Author:** [@wallyfoo](https://forum.elixirforum.com/u/wallyfoo)\
**Replies:** 9\
**Last updated:** [August 27, 2025, 5:54am UTC](https://forum.elixirforum.com/t/need-help-understanding-timex-date-structures-converting-timezones-local-presentation/72208 "2025-08-27T05:54:34Z")

</div>

This has been vexing me for a couple of days now, and I finally had a breakthrough. When I’m done with the explanation, please tell me: is this just obvious on the face of it? Or does this really not make sense with what…

---

## [Is there a better way to translate a date with Timex?](https://forum.elixirforum.com/t/is-there-a-better-way-to-translate-a-date-with-timex/62933)

<div class="topic-metadata">

**Author:** [@sergio](https://forum.elixirforum.com/u/sergio)\
**Replies:** 2\
**Last updated:** [April 15, 2024, 11:19pm UTC](https://forum.elixirforum.com/t/is-there-a-better-way-to-translate-a-date-with-timex/62933 "2024-04-15T23:19:17Z")

</div>

Using Timex, I’m trying to translate a date from “October 2024” to “Octubre 2024” (spanish). This works: \<% \[month, year\] = Date.utc\_today() |\> Timex.shift(months: 9) |\> Timex.format!("{Mfull} {YYYY}") # October …

---

## [Is there a way to see what version of a depency is loaded?](https://forum.elixirforum.com/t/is-there-a-way-to-see-what-version-of-a-depency-is-loaded/65572)

<div class="topic-metadata">

**Author:** [@Hermanverschooten](https://forum.elixirforum.com/u/Hermanverschooten)\
**Replies:** 7\
**Last updated:** [August 21, 2024, 4:44am UTC](https://forum.elixirforum.com/t/is-there-a-way-to-see-what-version-of-a-depency-is-loaded/65572 "2024-08-21T04:44:44Z")

</div>

Gettext released a new version (0.26) that breaks compatibiliy, the way you need to add/use Gettext has been changed. While it isn’t a problem for my project to make the necessary changes, it also breaks compilation for…

---

## [Timex.to\_datetime() does not return %Timex.AmbiguousDateTime{}](https://forum.elixirforum.com/t/timex-to-datetime-does-not-return-timex-ambiguousdatetime/54915)

<div class="topic-metadata">

**Author:** [@notsure](https://forum.elixirforum.com/u/notsure)\
**Replies:** 3\
**Last updated:** [March 29, 2023, 5:10pm UTC](https://forum.elixirforum.com/t/timex-to-datetime-does-not-return-timex-ambiguousdatetime/54915 "2023-03-29T17:10:53Z")

</div>

Hello all and thanks in advance! I am writing tests to handle time changes from DST and back. I cannot seem to trigger the %Timex.Ambiguous{} response from Timex.to\_datetime(): iex(10)\> Timex.to\_datetime({{2023, 11, 5}…

---

## [Timex 3 compare not working properly for daily granualarity](https://forum.elixirforum.com/t/timex-3-compare-not-working-properly-for-daily-granualarity/53073)

<div class="topic-metadata">

**Author:** [@itisfilipe](https://forum.elixirforum.com/u/itisfilipe)\
**Replies:** 2\
**Last updated:** [January 9, 2023, 10:27pm UTC](https://forum.elixirforum.com/t/timex-3-compare-not-working-properly-for-daily-granualarity/53073 "2023-01-09T22:27:01Z")

</div>

Timex 3 compare function either has a bug or I am not using it properly, check this code I took from my application: \> a = ~U\[2023-01-09 03:00:00Z\] \> b = ~U\[2023-01-09 22:09:22.257598Z\] \> c = ~U\[2023-01-10 03:00:00Z\] \> …

---

## [Using Timex in a unit test](https://forum.elixirforum.com/t/using-timex-in-a-unit-test/51767)

<div class="topic-metadata">

**Author:** [@ollien](https://forum.elixirforum.com/u/ollien)\
**Replies:** 3\
**Last updated:** [November 14, 2022, 5:53pm UTC](https://forum.elixirforum.com/t/using-timex-in-a-unit-test/51767 "2022-11-14T17:53:08Z")

</div>

I run my unit tests with mix test --no-start, as I don’t want my application to start when I run my unit tests. However, I also want to test some code that uses Timex for a calculation. If I naively attempt to use Timex …

---

## [Using a custom locale with Timex.from\_now/1](https://forum.elixirforum.com/t/using-a-custom-locale-with-timex-from-now-1/50230)

<div class="topic-metadata">

**Author:** [@seva](https://forum.elixirforum.com/u/seva)\
**Replies:** 0\
**Last updated:** [September 12, 2022, 10:15pm UTC](https://forum.elixirforum.com/t/using-a-custom-locale-with-timex-from-now-1/50230 "2022-09-12T22:15:11Z")

</div>

I’m trying to use a custom locale with Timex, so I can generate abbreviated time duration in words similar to Twitter: Timex.from\_now(Timex.to\_date({2015, 6, 24}), "en\_abbrev") # =\> "7y" # Instead of the default Timex.…

---

## [Timex: getting next Monday (or any other day)](https://forum.elixirforum.com/t/timex-getting-next-monday-or-any-other-day/49877)

<div class="topic-metadata">

**Author:** [@sauronnikko](https://forum.elixirforum.com/u/sauronnikko)\
**Replies:** 3\
**Last updated:** [August 30, 2022, 4:40am UTC](https://forum.elixirforum.com/t/timex-getting-next-monday-or-any-other-day/49877 "2022-08-30T04:40:23Z")

</div>

I’m using Timex and exq and need a way to enqueue certain jobs at a specific day of week, for example: on a Monday at 9:00 a.m. I can use enqueue\_at for this but I would need to specify the proper time. I can implement …

---

## [Format a DateTime using :strftime with the offset calculated in the hours](https://forum.elixirforum.com/t/format-a-datetime-using-strftime-with-the-offset-calculated-in-the-hours/41811)

<div class="topic-metadata">

**Author:** [@f0rest8](https://forum.elixirforum.com/u/f0rest8)\
**Replies:** 7\
**Last updated:** [March 12, 2022, 1:31pm UTC](https://forum.elixirforum.com/t/format-a-datetime-using-strftime-with-the-offset-calculated-in-the-hours/41811 "2022-03-12T13:31:27Z")

</div>

I know I’m missing something here, but I’ve bounced around from Calendar and Timex trying to get a :strftime format with the offset computed in the formatted hours to no avail. Is there a way to format a DateTime string…

---

## [Timex Oddity](https://forum.elixirforum.com/t/timex-oddity/45386)

<div class="topic-metadata">

**Author:** [@Onor.io](https://forum.elixirforum.com/u/Onor.io)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 4:16pm UTC](https://forum.elixirforum.com/t/timex-oddity/45386 "2022-01-20T16:16:52Z")

</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”, {…

---

## [Turn off or delay timex tzdata log messages](https://forum.elixirforum.com/t/turn-off-or-delay-timex-tzdata-log-messages/42428)

<div class="topic-metadata">

**Author:** [@vrod](https://forum.elixirforum.com/u/vrod)\
**Replies:** 7\
**Last updated:** [December 5, 2021, 9:34pm UTC](https://forum.elixirforum.com/t/turn-off-or-delay-timex-tzdata-log-messages/42428 "2021-12-05T21:34:04Z")

</div>

I am using timex for date maths and I notice that there are always debug messages when my app starts. I want to make my app wait until the tzdata has loaded. I see the Tzdata.ReleaseUpdater uses Process.send\_after(self…

---

## [Parse local datetime with timex](https://forum.elixirforum.com/t/parse-local-datetime-with-timex/17579)

<div class="topic-metadata">

**Author:** [@marcuslankenau](https://forum.elixirforum.com/u/marcuslankenau)\
**Replies:** 3\
**Last updated:** [November 16, 2021, 1:48pm UTC](https://forum.elixirforum.com/t/parse-local-datetime-with-timex/17579 "2021-11-16T13:48:49Z")

</div>

I am struggling to parse a local datetime with timex. The datetime string is like “26/10/2018 10:00” and I know it is CET or CEST. I managed to parse it with: Timex.parse!(time\_str, "{0D}/{0M}/{YYYY} {h24}:{m}") I the…

---

## [Timex parsing format 22-AUG-18](https://forum.elixirforum.com/t/timex-parsing-format-22-aug-18/38939)

<div class="topic-metadata">

**Author:** [@hassanRsiddiqi](https://forum.elixirforum.com/u/hassanRsiddiqi)\
**Replies:** 5\
**Last updated:** [April 14, 2021, 10:19am UTC](https://forum.elixirforum.com/t/timex-parsing-format-22-aug-18/38939 "2021-04-14T10:19:46Z")

</div>

Hi, I’m having hard time parsing a date format: 22-AUG-18 while using {:timex, "~\> 3.6"} , solution I have tried: Timex.parse(“22-AUG-18”, “{D}-{WDshort}-{YYYY}”) {:error, “Expected weekday abbreviation at line 1, co…

---

## [Tzdata error (via timex) - no match of right hand side value - phoenix won't start](https://forum.elixirforum.com/t/tzdata-error-via-timex-no-match-of-right-hand-side-value-phoenix-wont-start/36800)

<div class="topic-metadata">

**Author:** [@paulbhartzog](https://forum.elixirforum.com/u/paulbhartzog)\
**Replies:** 3\
**Last updated:** [February 1, 2021, 6:00pm UTC](https://forum.elixirforum.com/t/tzdata-error-via-timex-no-match-of-right-hand-side-value-phoenix-wont-start/36800 "2021-02-01T18:00:23Z")

</div>

\[info\] Application tzdata exited: exited in: Tzdata.App.start(:normal, \[\]) \*\* (EXIT) an exception was raised: \*\* (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed\_to\_start\_child, T…

---

## [Remote\_console error when logger lib call timex](https://forum.elixirforum.com/t/remote-console-error-when-logger-lib-call-timex/36363)

<div class="topic-metadata">

**Author:** [@omar8792](https://forum.elixirforum.com/u/omar8792)\
**Replies:** 1\
**Last updated:** [December 21, 2020, 9:05pm UTC](https://forum.elixirforum.com/t/remote-console-error-when-logger-lib-call-timex/36363 "2020-12-21T21:05:59Z")

</div>

Hi all! in our comapny we ve done a wrapper to the elixir logger to send all the logs in a unified way to the elastic search node. The library is an internal library that format the logs coming from elixir logger and fo…

---

## [Form for utc\_datetime](https://forum.elixirforum.com/t/form-for-utc-datetime/25253)

<div class="topic-metadata">

**Author:** [@azimlord](https://forum.elixirforum.com/u/azimlord)\
**Replies:** 22\
**Last updated:** [December 11, 2020, 9:56am UTC](https://forum.elixirforum.com/t/form-for-utc-datetime/25253 "2020-12-11T09:56:14Z")

</div>

Hi guys, I’m having some trouble with utc\_datetime. So I have a form that accept start\_time and end\_time which both in utc\_datetime and inside a bookings table. The problem is that I’m in Malaysia so the booking that …

---

## [Timex.now(timezone)](https://forum.elixirforum.com/t/timex-now-timezone/30024)

<div class="topic-metadata">

**Author:** [@travisf](https://forum.elixirforum.com/u/travisf)\
**Replies:** 23\
**Last updated:** [April 7, 2020, 2:01pm UTC](https://forum.elixirforum.com/t/timex-now-timezone/30024 "2020-04-07T14:01:43Z")

</div>

I’m sending a daily report which should be showing the current time set to mountain daylight time. However, after daylight savings time the report has been consistently an hour behind. I if I run Timex.now("MDT") in t…

---

## [Timex Tzdata error](https://forum.elixirforum.com/t/timex-tzdata-error/28146)

<div class="topic-metadata">

**Author:** [@andrewb](https://forum.elixirforum.com/u/andrewb)\
**Replies:** 3\
**Last updated:** [January 10, 2020, 10:05am UTC](https://forum.elixirforum.com/t/timex-tzdata-error/28146 "2020-01-10T10:05:53Z")

</div>

I am using Timex (Which is fantastic) but each day when I compile for the first time I get the following error: \[error\] GenServer :tzdata\_release\_updater terminating \*\* (ArgumentError) argument error (stdlib) :ets.l…

---

## [Seem to get a weird value when trying to store timestamp in DB](https://forum.elixirforum.com/t/seem-to-get-a-weird-value-when-trying-to-store-timestamp-in-db/26778)

<div class="topic-metadata">

**Author:** [@eugenebolshakov](https://forum.elixirforum.com/u/eugenebolshakov)\
**Replies:** 5\
**Last updated:** [November 14, 2019, 3:38pm UTC](https://forum.elixirforum.com/t/seem-to-get-a-weird-value-when-trying-to-store-timestamp-in-db/26778 "2019-11-14T15:38:33Z")

</div>

I’m trying to debug an intermittent test failure that I’m only getting on CI. I’m fairly new to elixir and might be missing something obvious or not explaining the issue clearly, so would appreciate any advice / tips! I…

---

## [Timex Compare - granularity options](https://forum.elixirforum.com/t/timex-compare-granularity-options/26270)

<div class="topic-metadata">

**Author:** [@petrvecera](https://forum.elixirforum.com/u/petrvecera)\
**Replies:** 2\
**Last updated:** [October 22, 2019, 5:23pm UTC](https://forum.elixirforum.com/t/timex-compare-granularity-options/26270 "2019-10-22T17:23:16Z")

</div>

Hi guys, I am confused by Timex Compare, the granularity options: \* :year \* :years \* :month \* :months \* :week \* :weeks What is difference between year , years ? Why are there even 2 options? I can’t get a different …

---

## [Timex compare](https://forum.elixirforum.com/t/timex-compare/23756)

<div class="topic-metadata">

**Author:** [@RazgrizHsu](https://forum.elixirforum.com/u/RazgrizHsu)\
**Replies:** 5\
**Last updated:** [July 6, 2019, 2:59pm UTC](https://forum.elixirforum.com/t/timex-compare/23756 "2019-07-06T14:59:41Z")

</div>

Hi, all, i’m trying compare with timex variables, but i don’t know why this code work like that.. dts = Timex.parse!( "2019-01-01T00:00:00.000Z", "{ISO:Extended:Z}" ) now = Timex.parse!( "2019-01-01T00:00:00.100Z", "…

---

## [Querying for Timezones in Timex or some other library?](https://forum.elixirforum.com/t/querying-for-timezones-in-timex-or-some-other-library/21188)

<div class="topic-metadata">

**Author:** [@fireproofsocks](https://forum.elixirforum.com/u/fireproofsocks)\
**Replies:** 5\
**Last updated:** [March 27, 2019, 6:45pm UTC](https://forum.elixirforum.com/t/querying-for-timezones-in-timex-or-some-other-library/21188 "2019-03-27T18:45:41Z")

</div>

I’ve often found it helpful to be able to reference timezones for humans using an app. E.g. we have a database record for a person or a store location and we want to know what timezone they are in. When I use Timex, I …

---

## [Timex.Timezone.convert/2 question](https://forum.elixirforum.com/t/timex-timezone-convert-2-question/19904)

<div class="topic-metadata">

**Author:** [@benonymus](https://forum.elixirforum.com/u/benonymus)\
**Replies:** 20\
**Last updated:** [February 8, 2019, 6:14pm UTC](https://forum.elixirforum.com/t/timex-timezone-convert-2-question/19904 "2019-02-08T18:14:34Z")

</div>

Hey I am using this function, and the result does only show until the seconds, doesn’t show milliseconds, not even the .000000. Why is that? Before it did show it. It used to return this: 2018-09-15T15:00:00.000000+0…

---

## [HTML date tag and :utc\_datetime type](https://forum.elixirforum.com/t/html-date-tag-and-utc-datetime-type/18216)

<div class="topic-metadata">

**Author:** [@phoebe](https://forum.elixirforum.com/u/phoebe)\
**Replies:** 1\
**Last updated:** [January 17, 2019, 3:50am UTC](https://forum.elixirforum.com/t/html-date-tag-and-utc-datetime-type/18216 "2019-01-17T03:50:38Z")

</div>

Hi, What transformation is needed to get date input from an HTML date tag in a form to be cast correctly to a :utc\_datetime type in a schema? I have a schema for a calendar event: schema "events" do field :start\_d…

---

## [How to create custom Time with month and day name](https://forum.elixirforum.com/t/how-to-create-custom-time-with-month-and-day-name/17600)

<div class="topic-metadata">

**Author:** [@shahryarjb](https://forum.elixirforum.com/u/shahryarjb)\
**Replies:** 4\
**Last updated:** [October 30, 2018, 6:04am UTC](https://forum.elixirforum.com/t/how-to-create-custom-time-with-month-and-day-name/17600 "2018-10-30T06:04:37Z")

</div>

Hello, Im using Timex lib in order to create custom time which I need. for example I need something like this: "Mon, 29 Oct 2018 23:38:55 +0330" and I did this like this: iran\_now\_time = Timex.now("Iran") "Mon, #{ira…

---

## [Using Custom Timestamps in Migrations](https://forum.elixirforum.com/t/using-custom-timestamps-in-migrations/14407)

<div class="topic-metadata">

**Author:** [@jacky](https://forum.elixirforum.com/u/jacky)\
**Replies:** 1\
**Last updated:** [May 28, 2018, 5:04am UTC](https://forum.elixirforum.com/t/using-custom-timestamps-in-migrations/14407 "2018-05-28T05:04:21Z")

</div>

I’ve been working to build an application using Distillery for some time now. I’ve moved to implement release tasks so I can do things like send stats when the application’s booting and run migrations. I haven’t taken it…

---

## [Timex parsing invalid dates and the db is blowing up](https://forum.elixirforum.com/t/timex-parsing-invalid-dates-and-the-db-is-blowing-up/13825)

<div class="topic-metadata">

**Author:** [@polypush135](https://forum.elixirforum.com/u/polypush135)\
**Replies:** 2\
**Last updated:** [April 24, 2018, 9:46am UTC](https://forum.elixirforum.com/t/timex-parsing-invalid-dates-and-the-db-is-blowing-up/13825 "2018-04-24T09:46:44Z")

</div>

Thoughts on how I can catch this type of error? I have an invalid date ie 11/31/2910. There is no 31st day of November. But my little logic does not catch that and timex seems to parse it all the same. pry(2)\> Timex.par…
