Module datetime

Datetime conversion functions to convert to and from datetime tuples for standard formats.

Copyright © 2009 Mr Buzz, Inc.

Authors: Jacob Perkins.

Description

Datetime conversion functions to convert to and from datetime tuples for standard formats.

Data Types

date()

date() = {Year::integer(), Month::integer(), Day::integer()}

daterange()

daterange() = {date(), date()}

datetime()

datetime() = {date(), time()}

time()

time() = {Hour::integer(), Min::integer(), Sec::integer()}

Function Index

fromstring/1Convert rfc1123 format string to a datetime tuple.
in_range/2
iso_datetime/1Convert ISO format string to a datetime tuple.
iso_string/1Convert date or datetime tuple to ISO format string.
range_dates/1Expand the date range into a list of all dates included in the range.
range_split_years/1Given a date range, returns a list of date ranges, each range inclusive to the same year.
seconds_diff/2
time_diff/2
tostring/1Convert a UTC datetime tuple to a rfc1123 format string.

Function Details

fromstring/1

fromstring(S::string()) -> datetime()

Equivalent to httpd_util:convert_request_date.

Convert rfc1123 format string to a datetime tuple.

in_range/2

in_range() -> term()

iso_datetime/1

iso_datetime(S::string()) -> datetime()

Convert ISO format string to a datetime tuple.

iso_string/1

iso_string(Date::date() | datetime()) -> string()

Convert date or datetime tuple to ISO format string.

range_dates/1

range_dates(X1::daterane()) -> [date()]

Expand the date range into a list of all dates included in the range.

range_split_years/1

range_split_years(X1::daterange()) -> [daterange()]

Given a date range, returns a list of date ranges, each range inclusive to the same year. The first range begins with the first date, and the last range ends with the second date.

seconds_diff/2

seconds_diff() -> term()

time_diff/2

time_diff() -> term()

tostring/1

tostring(DateTime::datetime()) -> string()

Convert a UTC datetime tuple to a rfc1123 format string.

See also: calendar:universal_time_to_local_time/1, httpd_util:rfc1123_date/1.


Generated by EDoc, Jul 14 2009, 14:06:01.