Skip to content

Posts tagged programming

Posts under this tag. Back to all posts when you want the full stream.

@latest_post

Parse Twitter's date format with Elixir

Twitter's API date format

If you are using Twitter's API you've probably come across their particular way of formatting dates on user's tweets:

Elixir
created_at: "Sun Aug 15 14:15:50 +0000 2021",

Let's see how we would parse that into something like this:

Elixir
~U[2021-08-15 14:15:50Z]

Timex

Let's use Timex  for parsing.
Add this to you project dependencies:

mix.exs
# ...
defp deps do
[
{:timex, "~> 3.7"}
# ...

Writing stream

1 older posts tagged programming.