class oandapyV20.types.DateTime(dateTime)

representation of a DateTime as a RFC 3339 string.

  • 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.


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

A ValueError exception is raised in case of an invalid value


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


value property.