XMLRPC.DateTime

Struct to store a date-time in xml-rpc format (a variation on iso8601)

Note, there is significant ambiguity in the formatting of date-time in xml-rpc. This is a thin wrapper around a basic parser, but knowledge of the API you are trying to connect to will be valuable. Consider writing your own decoder (and perhaps encoder) to speak to non standard end-points…

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 iso8601 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 iso8601 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