XMLRPC.DateTime

Source

Summary

new(arg1)

Create a new datetime in the (odd) format that the XMLRPC spec claims is iso8601

to_erlang_date(datetime)

Attempt to parse a returned date. Note there is significant ambiguity around what constitutes an valid date… The spec says no hyphens between date parts and no timezone. However, servers in the field sometimes seem to return IOS8601 dates

Types

t :: %XMLRPC.DateTime{raw: String.t}

Functions

new(arg1)

Create a new datetime in the (odd) format that the XMLRPC spec claims is iso8601

iex> XMLRPC.DateTime.new({{2015,6,9},{9,7,2}})
%XMLRPC.DateTime{raw: "20150609T09:07:02"}
Source
to_erlang_date(datetime)

Attempt to parse a returned date. Note there is significant ambiguity around what constitutes an valid date… The spec says no hyphens between date parts and no timezone. However, servers in the field sometimes seem to return IOS8601 dates…

We attempt to be generous in parsing, but no attempt is made to handle timezones. For more accurate parsing, including handling timezones, see the Calendar library

iex>XMLRPC.DateTime.to_erlang_date(%XMLRPC.DateTime{raw: "20150609T09:07:02"})
{:ok, {{2015, 6, 9}, {9, 7, 2}}}
Source