Fulib v0.1.5 Fulib.DateTime View Source

Link to this section Summary

Link to this section Functions

时间日期的格式化话

opts

* timezone
  - :original

* :locale

* format
  - :gmt
  - :long         eg: 2017-03-10 09:38:30 
  - :utc_strftime eg: 2017-03-10T01:38:12Z
  - :short        eg: 2017-03-10 09:39
  - :utc_iso8601  eg: 2017-03-10T01:46:27.860643+00:00
  - :date         eg: 2017-03-10
  - :date_short   eg: 2017-3-10
  - :diff
  _ :human

* overflow_format
  - :date
Link to this function

format!(datetime, format, opts) View Source

Link to this function

format_diff!(datetime, opts \\ []) View Source

Link to this function

format_human!(datetime, opts \\ []) View Source

Link to this function

get_zone_time(datetime, timezone \\ "Asia/Shanghai") View Source

Link to this function

naive_now(timezone \\ "Asia/Shanghai") View Source

Link to this function

now(timezone \\ "Asia/Shanghai") View Source

Link to this function

range(date_range) View Source
range(atom() | nil) :: tuple()

Link to this function

range(begin_shift, end_shift) View Source
range(integer(), integer()) :: tuple()

得到某一时间范围

Examples

iex> range(:today)
{~N[2018-07-25 00:00:00], ~N[2018-07-26 00:00:00]}

iex> range(4)
{~N[2018-07-22 00:00:00], ~N[2018-07-26 00:00:00]}

iex> range(nil)
{nil, nil}