ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - DevL/good_times: Expressive and easy to use datetime functions in Elixir.
Expressive and easy to use datetime functions in Elixir. - DevL/good_times
Visit Site

GitHub - DevL/good_times: Expressive and easy to use datetime functions in Elixir.

GitHub - DevL/good_times: Expressive and easy to use datetime functions in Elixir.

GoodTimes

Build Status Inline docs Hex.pm Documentation

Expressive and easy to use datetime functions.

Unbelivably nice...I'm proud that we have this.

-- Josh Adams, Elixir sips episode 145

Examples

iex> import GoodTimes
nil
iex> now
{{2015, 3, 16}, {16, 58, 25}}
iex> 10 |> seconds_from_now
{{2015, 3, 16}, {16, 58, 35}}
iex> 60 |> seconds_ago
{{2015, 3, 16}, {16, 57, 25}}
iex> import GoodTimes.Convert
nil
iex> now |> to_date
{2015, 3, 16}
iex> import GoodTimes.Date
nil
iex> yesterday
{2015, 3, 15}
iex> tomorrow |> at({12, 30, 0})
{{2015, 3, 17}, {12, 30, 0}}
iex> import GoodTimes.Boundary
nil
iex> now |> end_of_week
{{2015, 3, 22}, {23, 59, 59}}
iex> import GoodTimes.Generate
nil
iex> all_days_after({{2016, 2, 28}, {10, 0, 0}}) |> Enum.take(3)
[{{2016, 2, 28}, {10, 0, 0}}, {{2016, 2, 29}, {10, 0, 0}},
 {{2016, 3, 1}, {10, 0, 0}}]

Usage

Update your mix.exs file and run mix deps.get.

defp deps do
  [{:good_times, "~> 1.1"}]
end

Import the module or modules holding the functions you want to use.

defmodule MyModule do
  import GoodTimes            # core functions.
  import GoodTimes.Boundary   # find boundaries between time units.
  import GoodTimes.Convert    # convert between dates, datetimes and times.
  import GoodTimes.Date       # functions operating on and returning dates.
  import GoodTimes.Generate   # functions generating streams of time units.

For more information, see the full documentation.

Known limitations

As GoodTimes uses Erlangs calendar module, dates and times before year 0 aren't supported.

Online documentation

For more information, see the full documentation.

Contributing

  1. Fork this repository
  2. Create your feature branch (git checkout -b better-times)
  3. Commit your changes (git commit -am 'Let the good times roll!')
  4. Push to the branch (git push origin better-times)
  5. Create a new Pull Request

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory