Skip to content

Latest commit

 

History

History
217 lines (119 loc) · 5.11 KB

ersip_hdr_date.md

File metadata and controls

217 lines (119 loc) · 5.11 KB

Module ersip_hdr_date

Data Types


date() = calendar:date()

datetime() = {date, calendar:datetime()}

parse_error() = {invalid_date, bad_timezone} | {invalid_date, bad_datetime} | {invalid_date, wrong_weekday} | {invalid_date, {incorrect_date, triplet()}} | {invalid_date, {incorrect_time, triplet()}} | {invalid_date, no_datetime}

parse_result() = {ok, datetime()} | {error, parse_error()}

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

time() = calendar:time()

triplet() = {non_neg_integer(), non_neg_integer(), non_neg_integer()}

Function Index

assemble/1Serialize Date header to iolist.
assemble_bin/1Serialize Date header to binary.
build/2Build SIP header.
date/1Extract date from Date header (GMT).
is_valid/1Check that Erlang term is valid Date header.
make/1Make Date header from binary, raw representation of Date or from raw SIP header.
make/2Make date header from date and time.
now/0Date header for current moment of time.
parse/1Parse Date header from binary or from raw SIP header.
raw/1Raw representation of Date header..
time/1Extract time from Time header (GMT).

Function Details

assemble/1


assemble(DT::datetime()) -> iolist()

Serialize Date header to iolist.

assemble_bin/1


assemble_bin(DT::datetime()) -> binary()

Serialize Date header to binary.

build/2


build(HeaderName::binary(), DateTime::datetime()) -> ersip_hdr:header()

Build SIP header.

date/1


date(X1::datetime()) -> date()

Extract date from Date header (GMT).

is_valid/1


is_valid(DT::term()) -> boolean()

Check that Erlang term is valid Date header.

make/1


make(Bin::binary() | ersip_hdr:header()) -> datetime()

Make Date header from binary, raw representation of Date or from raw SIP header. If syntax is invalid then this function raises error.

make/2


make(Date::date(), Time::time()) -> datetime()

Make date header from date and time.

now/0


now() -> datetime()

Date header for current moment of time.

parse/1


parse(Bin::binary() | ersip_hdr:header()) -> parse_result()

Parse Date header from binary or from raw SIP header.

raw/1


raw(X1::datetime()) -> raw()

Raw representation of Date header..

time/1


time(X1::datetime()) -> time()

Extract time from Time header (GMT).