Marcus
Datix - A date-time parser using Calendar.strftime format strings
Hi,
datix is a date-time parse using Calendar.strftime format strings.
Some examples:
iex(1)> Datix.strptime("2021-01-13", "%x")
{:ok, %{day: 13, month: 1, year: 2021}}
iex(2)> Datix.strptime("21/01/10", "%y/%m/%d")
{:ok, %{day: 10, month: 1, year_2_digit: 21}}
iex(3)> Datix.strptime("1 PM", "%-I %p")
{:ok, %{am_pm: :pm, hour_12: 1}}
iex(4)> Datix.strptime("Di", "%a", abbreviated_day_of_week_names: ~w(Mo Di Mi Do Fr Sa So))
{:ok, %{day_of_week: 2}}
iex(5)> Datix.Date.parse("2021/04/15", "%Y/%m/%d")
{:ok, ~D[2021-04-15]}
iex(6)> Datix.NaiveDateTime.parse("2021/04/15 11:55:25", "%Y/%m/%d %X")
{:ok, ~N[2021-04-15 11:55:25]}
iex(7)> Datix.DateTime.parse("2018/12/30 11:23:55 CEST+0200", "%Y/%m/%d %H:%M:%S %Z%z")
{:ok, ~U[2018-12-30 09:23:55Z], {"CEST", 7200}}
iex(8)> Datix.Date.parse("1736/13/03", "%Y/%m/%d", calendar: Cldr.Calendar.Coptic)
{:ok, ~D[1736-13-03 Cldr.Calendar.Coptic]}
or more information, please see the documentation.
Popular in Libraries
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir.
I...
New
Hey all,
We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3!
We have successfully on-boarded the full suite of integration tests (...
New
Just looking for a little feedback on a tiny helper library I built -
Sometimes I find the need to convert maps with atom keys to maps...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
LiveMotion enables high performance animations declared on the server and run on the client.
As a follow up to my previous thread A libr...
New
Hi everyone,
I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
I built a silly site for Halloween that uses Phoenix Channels on the backend, and React on the frontend. I had many problems integrating ...
New
Hello all,
I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
New
Other popular topics
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
Hi all,
Trying to get some more clarity over utc_datetime and naive_datetime for Ecto:
https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New







