time_zone_info v0.1.0 TimeZoneInfo.NaiveDateTimeUtil View Source

Some functions to handle datetimes in TimeZoneInfo.

Link to this section Summary

Functions

Returns true if naive_datetime1 is after or equal to naive_datetime2.

Returns true if naive_datetime1 is after or equal to naive_datetime2.

Returns true if naive_datetime1 is before naive_datetime2.

Returns true if naive_datetime1 is before or equal to naive_datetime2.

Returns a naive dattime at the end of the year for the given year.

Computes the date and time from the specified number of gregorian seconds.

Builds a new ISO naive datetime from parsed IANA data.

Builds a new ISO naive datetime from iso days.

Returns true if the given time spans are overlapping.

Sorts the given list of tuples by the datetime specified in the first element.

Computes the number of gregorian seconds starting with year 0 and ending at the specified date and time.

Returns the Calendar.iso_days/0 format of the specified date.

Link to this section Functions

Link to this function

after?(naive_datetime1, naive_datetime2)

View Source

Returns true if naive_datetime1 is after or equal to naive_datetime2.

Link to this function

after_or_equal?(naive_datetime1, naive_datetime2)

View Source
after_or_equal?(NaiveDateTime.t(), NaiveDateTime.t()) :: boolean()

Returns true if naive_datetime1 is after or equal to naive_datetime2.

Link to this function

before?(naive_datetime1, naive_datetime2)

View Source

Returns true if naive_datetime1 is before naive_datetime2.

Link to this function

before_or_equal?(naive_datetime1, naive_datetime2)

View Source
before_or_equal?(NaiveDateTime.t(), NaiveDateTime.t()) :: boolean()

Returns true if naive_datetime1 is before or equal to naive_datetime2.

Returns a naive dattime at the end of the year for the given year.

Link to this function

from_gregorian_seconds(seconds)

View Source
from_gregorian_seconds(TimeZoneInfo.gregorian_seconds()) :: NaiveDateTime.t()

Computes the date and time from the specified number of gregorian seconds.

Builds a new ISO naive datetime from parsed IANA data.

Link to this function

from_iana(year, tuple)

View Source
from_iana(Calendar.year(), tuple()) :: NaiveDateTime.t()
Link to this function

from_iso_days(iso_days)

View Source
from_iso_days(Calendar.iso_days()) :: NaiveDateTime.t()

Builds a new ISO naive datetime from iso days.

Link to this function

new(year, month \\ 1, day \\ 1, hour \\ 0, minute \\ 0, second \\ 0)

View Source

Builds a new ISO naive datetime.

This function differs in the types and arity from NaiveDateTime.new/6.

Returns true if the given time spans are overlapping.

Link to this function

sort(tuples, dir \\ :asc)

View Source
sort([{NaiveDateTime.t(), any()}], :desc | :asc) :: [{NaiveDateTime.t(), any()}]

Sorts the given list of tuples by the datetime specified in the first element.

Link to this function

to_gregorian_seconds(datetime)

View Source
to_gregorian_seconds(NaiveDateTime.t()) :: TimeZoneInfo.gregorian_seconds()

Computes the number of gregorian seconds starting with year 0 and ending at the specified date and time.

Link to this function

to_iso_days(naive_date_time)

View Source
to_iso_days(NaiveDateTime.t()) :: Calendar.iso_days()

Returns the Calendar.iso_days/0 format of the specified date.

Link to this function

to_utc(datetime, time_standard, utc_offset, std_offset \\ 0)

View Source

Converts a datetime to UTC.