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.
Builds a new ISO naive datetime.
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.
Converts a datetime to UTC.
Link to this section Functions
after?(naive_datetime1, naive_datetime2)
View Sourceafter?(NaiveDateTime.t(), NaiveDateTime.t()) :: boolean()
Returns true
if naive_datetime1
is after or equal to naive_datetime2
.
after_or_equal?(naive_datetime1, naive_datetime2)
View Sourceafter_or_equal?(NaiveDateTime.t(), NaiveDateTime.t()) :: boolean()
Returns true
if naive_datetime1
is after or equal to naive_datetime2
.
before?(naive_datetime1, naive_datetime2)
View Sourcebefore?(NaiveDateTime.t(), NaiveDateTime.t()) :: boolean()
Returns true if naive_datetime1
is before naive_datetime2
.
before_or_equal?(naive_datetime1, naive_datetime2)
View Sourcebefore_or_equal?(NaiveDateTime.t(), NaiveDateTime.t()) :: boolean()
Returns true
if naive_datetime1
is before or equal to naive_datetime2
.
end_of_year(year)
View Sourceend_of_year(Calendar.year()) :: NaiveDateTime.t()
Returns a naive dattime at the end of the year for the given year
.
from_gregorian_seconds(seconds)
View Sourcefrom_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.
from_iana(year, tuple)
View Sourcefrom_iana(Calendar.year(), tuple()) :: NaiveDateTime.t()
from_iana(year, month, day, arg)
View Sourcefrom_iana( Calendar.year(), Calendar.month(), TimeZoneInfo.IanaParser.day(), TimeZoneInfo.IanaParser.time() ) :: NaiveDateTime.t()
from_iso_days(iso_days)
View Sourcefrom_iso_days(Calendar.iso_days()) :: NaiveDateTime.t()
Builds a new ISO naive datetime from iso days.
new(year, month \\ 1, day \\ 1, hour \\ 0, minute \\ 0, second \\ 0)
View Sourcenew( Calendar.year(), Calendar.month(), TimeZoneInfo.IanaParser.day(), Calendar.hour(), Calendar.minute(), Calendar.second() ) :: NaiveDateTime.t()
Builds a new ISO naive datetime.
This function differs in the types and arity from NaiveDateTime.new/6
.
overlap?(arg1, arg2)
View Sourceoverlap?( {NaiveDateTime.t(), NaiveDateTime.t()}, {NaiveDateTime.t(), NaiveDateTime.t()} ) :: boolean()
Returns true
if the given time spans are overlapping.
sort(tuples, dir \\ :asc)
View Sourcesort([{NaiveDateTime.t(), any()}], :desc | :asc) :: [{NaiveDateTime.t(), any()}]
Sorts the given list of tuples by the datetime specified in the first element.
to_gregorian_seconds(datetime)
View Sourceto_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.
to_iso_days(naive_date_time)
View Sourceto_iso_days(NaiveDateTime.t()) :: Calendar.iso_days()
Returns the Calendar.iso_days/0 format of the specified date.
to_utc(datetime, time_standard, utc_offset, std_offset \\ 0)
View Sourceto_utc( NaiveDateTime.t(), TimeZoneInfo.time_standard(), Calendar.utc_offset(), Calendar.std_offset() ) :: NaiveDateTime.t()
Converts a datetime to UTC.