DateTime

class oandapyV20.types.DateTime(dateTime)

representation of a DateTime as a RFC 3339 string.

Parameters:
  • dateTime (string, datetime instance, dict (required)) –
    the dateTime parameter must be:
    • a valid RFC3339 string representing a date-time, or
    • a dict holding the relevant datetime parts, or
    • a datetime.datetime instance
  • value property is always RFC3339 datetime string (The) –
  • seconds are in microseconds. This compatible with (Fractional) –
  • datetime.datetime.

Example

>>> print DateTime("2014-07-02T04:00:00.000000Z").value
>>> print DateTime({"year": 2014, "month": 12, "day": 2,
...                 "hour": 13, "minute": 48, "second": 12}).value
>>> from datetime import datetime
>>> print DateTime(datetime.now()).value

A ValueError exception is raised in case of an invalid value

__init__(dateTime)

x.__init__(…) initializes x; see help(type(x)) for signature

value

value property.