Module iso8601

Data Types

datetime()

datetime() = {calendar:date(), {hour(), minute(), second() | float()}}

datetime_plist()

datetime_plist() = [{atom(), integer()}]

day()

day() = 1..31

hour()

hour() = 0..23

minute()

minute() = 0..59

month()

month() = 1..12

second()

second() = 0..59

timestamp()

timestamp() = {MegaSecs::integer(), Secs::integer(), MicroSecs::integer() | float()}

year()

year() = non_neg_integer()

Function Index

add_days/2Add some days to the supplied datetime().
add_months/2Add some months to the supplied datetime().
add_time/4Add some time to the supplied calendar:datetime().
add_years/2Add some years to the supplied datetime().
apply_duration/2Return new datetime after apply duration.
format/1Convert a util:timestamp() or a calendar-style {date(), time()} tuple to an ISO 8601 formatted string.
parse/1Convert an ISO 8601 formatted string to a {date(), time()}
parse_duration/1Convert an ISO 8601 Durations string to a.
parse_exact/1Convert an ISO 8601 formatted string to a {date(), time()} tuple with seconds precision to 3 decimal places.
subtract_time/4Subtract some time from the supplied calendar:datetime().

Function Details

add_days/2

add_days(Timestamp::datetime() | timestamp(), D::integer()) -> datetime()

Add some days to the supplied datetime().

add_months/2

add_months(Timestamp::datetime() | timestamp(), M::integer()) -> datetime()

Add some months to the supplied datetime().

add_time/4

add_time(Timestamp::calendar:datetime(), H::integer(), M::integer(), S::integer()) -> calendar:datetime()

Add some time to the supplied calendar:datetime().

add_years/2

add_years(Timestamp::datetime() | timestamp(), Y::integer()) -> datetime()

Add some years to the supplied datetime().

apply_duration/2

apply_duration(Datetime::datetime(), Duration::string()) -> datetime()

Return new datetime after apply duration.

format/1

format(Timestamp::datetime() | timestamp()) -> binary()

Convert a util:timestamp() or a calendar-style {date(), time()} tuple to an ISO 8601 formatted string. Note that this function always returns a string with no offset (i.e., ending in "Z").

parse/1

parse(Bin::iodata()) -> calendar:datetime()

Convert an ISO 8601 formatted string to a {date(), time()}

parse_duration/1

parse_duration(Bin::string()) -> datetime_plist()

Convert an ISO 8601 Durations string to a

parse_exact/1

parse_exact(Bin::iodata()) -> calendar:datetime()

Convert an ISO 8601 formatted string to a {date(), time()} tuple with seconds precision to 3 decimal places

subtract_time/4

subtract_time(Datetime::calendar:datetime(), H::integer(), M::integer(), S::integer()) -> calendar:datetime()

Subtract some time from the supplied calendar:datetime().


Generated by EDoc