Copyright © 2009-2016 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
ldom() = 28 | 29 | 30 | 31
month() = 1..12
year() = integer()
datetime_to_timestamp/1 | Translate a local time date to UNIX timestamp. |
days_in_year/1 | Return the number of days in a certain year. |
diff/2 | Return the absolute difference between two dates. |
format/2 | Format the current date according to the format and the timezone settings in the context. |
format/3 | Format a date according to the format and the timezone settings in the context. |
format_utc/2 | Format the current date in UTC. |
format_utc/3 | Format the date using the UTC timezone. |
is_leap_year/1 | |
last_day_of_the_month/2 | |
month_boundaries/1 | Return the month-boundaries of a given date. |
next_day/1 | Return the date one day later. |
next_hour/1 | Return the date one hour later. |
next_minute/1 | Return the date one minute later. |
next_month/1 | Return the date one month later. |
next_second/1 | Return the date one second later. |
next_week/1 | Return the date one week later. |
next_year/1 | Return the date one year later. |
prev_day/1 | Return the date one day earlier. |
prev_hour/1 | Return the date one hour earlier. |
prev_minute/1 | Return the date one minute earlier. |
prev_month/1 | Return the date one month earlier. |
prev_second/1 | Return the date one second earlier. |
prev_week/1 | Return the date one week earlier. |
prev_year/1 | Return the date one year earlier. |
timesince/2 | Show a humanized version of a relative datetime. |
timesince/3 | Show a humanized version of a period between two dates. |
timesince/4 | |
timesince/5 | Show a humanized version of a period between two dates. |
timestamp/0 | Calculate the current UNIX timestamp (seconds since Jan 1, 1970). |
timestamp_to_datetime/1 | Translate UNIX timestamp to local datetime. |
to_datetime/1 | Convert an input to a (universal) datetime, using to_date/1 and to_time/1. |
to_datetime/2 | |
to_local/2 | Convert a time to the local context time using the current timezone. |
to_utc/2 | Convert a time to the local context time using the current timezone. |
undefined_if_invalid_date/1 | Return 'undefined' if a given date is invalid. |
week_boundaries/1 | Return the week-boundaries of a given date. |
week_boundaries/2 | |
week_start/0 | Return the date the current week starts (monday). |
week_start/2 |
datetime_to_timestamp(DT) -> any()
Translate a local time date to UNIX timestamp
days_in_year(Y) -> any()
Return the number of days in a certain year.
diff(Date1, Date2) -> any()
Return the absolute difference between two dates. Does not take daylight saving into account.
format(Format, Context) -> any()
Format the current date according to the format and the timezone settings in the context.
format(Date, Format, Context) -> any()
Format a date according to the format and the timezone settings in the context.
format_utc(Format, Context) -> any()
Format the current date in UTC.
format_utc(Date, Format, Context) -> any()
Format the date using the UTC timezone.
month_boundaries(X1) -> any()
Return the month-boundaries of a given date
next_day(Date) -> any()
Return the date one day later.
next_hour(Date) -> any()
Return the date one hour later.
next_minute(Date) -> any()
Return the date one minute later.
next_month(X1) -> any()
Return the date one month later. Gives unpredictable results if the day doesn't exist in the next month. (eg. feb 30 will become feb 28).
next_second(Date) -> any()
Return the date one second later.
next_week(DT) -> any()
Return the date one week later.
next_year(X1) -> any()
Return the date one year later.
prev_day(Date) -> any()
Return the date one day earlier.
prev_hour(Date) -> any()
Return the date one hour earlier.
prev_minute(Date) -> any()
Return the date one minute earlier.
prev_month(X1) -> any()
Return the date one month earlier.
prev_second(Date) -> any()
Return the date one second earlier.
prev_week(DT) -> any()
Return the date one week earlier.
prev_year(X1) -> any()
Return the date one year earlier.
timesince(Date, Context) -> string()
Show a humanized version of a relative datetime. Like "4 months, 3 days ago".
timesince(Date, Base::BaseDate, Context) -> string()
Show a humanized version of a period between two dates. Like "4 months, 3 days ago".
timesince(Date, Base, IndicatorStrings, Context) -> any()
timesince(Date, Base::BaseDate, IndicatorStrings, Mode, Context) -> string()
Show a humanized version of a period between two dates. Like "4 months, 3 days ago".
WhenText
is a string containing a maximum of three tokens. Example "ago, now, in"
timestamp() -> any()
Calculate the current UNIX timestamp (seconds since Jan 1, 1970)
timestamp_to_datetime(Seconds) -> any()
Translate UNIX timestamp to local datetime.
to_datetime(Input) -> calendar:datetime()
Convert an input to a (universal) datetime, using to_date/1 and to_time/1. When the input is a string, it is expected to be in iso 8601 format, although it can also handle timestamps without time zones. The time component of the datetime is optional.
to_datetime(DT, Tz) -> any()
to_local(Date::calendar:datetime() | undefined | time_not_exists, Tz::string() | binary() | z:context()) -> calendar:datetime() | undefined
Convert a time to the local context time using the current timezone.
to_utc(Date::calendar:datetime() | undefined | time_not_exists, Tz::string() | binary() | z:context()) -> calendar:datetime() | undefined
Convert a time to the local context time using the current timezone.
undefined_if_invalid_date(Date) -> any()
Return 'undefined' if a given date is invalid
week_boundaries(Date) -> any()
Return the week-boundaries of a given date. WeekStart is optional, and determines on which day a week starts.
week_boundaries(Date, WeekStart) -> any()
week_start() -> any()
Return the date the current week starts (monday)
week_start(StartDayNr, X2) -> any()
Generated by EDoc