Package pyxb :: Package binding :: Module datatypes :: Class dateTime |
[hide private]
[frames] | no frames]

# type dateTime

source code

                        object --+
                                 |
                           cscRoot --+
                                     |
         utils.utility.Locatable_mixin --+
                                         |
                  basis._TypeBinding_mixin --+
                                             |
                                object --+   |
                                         |   |
    utils.utility._DeconflictSymbols_mixin --+
                                             |
                            object --+       |
                                     |       |
                               cscRoot --+   |
                                         |   |
                basis._DynamicCreate_mixin --+
                                             |
                    basis.simpleTypeDefinition --+
                                                 |
                                _PyXBDateTime_base --+
                                                     |
                                    object --+       |
                                             |       |
                                 datetime.date --+   |
                                                 |   |
                                 datetime.datetime --+
                                                     |
                                                    dateTime

XMLSchema datatype dateTime.

This class uses the Python `datetime.datetime` class as its underlying representation. Unless pyxb.PreserveInputTimeZone() is used, all timezoned dateTime objects are in UTC. Presence of time zone information in the lexical space is preserved by a non-empty tzinfo field, which should always be zero minutes offset from UTC unless the input time zone was preserved.

Warning: The value space of Python's `datetime.datetime` class is more restricted than that of `xs:datetime`. As a specific example, Python does not support negative years or years with more than four digits. For now, the convenience of having an object that is compatible with Python is more important than supporting the full value space. In the future, the choice may be left up to the developer.

Nested Classes | [hide private]
_XsdBaseType XMLSchema datatype anySimpleType.

Instance Methods | [hide private]
`datetime.datetime` (NOT `xsd.dateTime`) |
aslocal(self) Returns a `datetime.datetime` instance denoting the same time as this instance but adjusted to be in the local time zone. | source code
Inherited from `_PyXBDateTime_base`: `__reduce__` Inherited from `basis.simpleTypeDefinition`: `__init__`, `pythonLiteral`, `xsdConstraintsOK`, `xsdLiteral`, `xsdValueLength` Inherited from `basis.simpleTypeDefinition` (private): `_checkValidValue`, `_isValidValue`, `_setAttribute`, `_toDOM_csc`, `_validateBinding_vx` Inherited from `basis._TypeBinding_mixin`: `__setattr__`, `toDOM`, `toxml`, `validateBinding` Inherited from `basis._TypeBinding_mixin` (private): `_TypeBinding_mixin__checkNilCtor`, `_TypeBinding_mixin__getValidationConfig`, `_constructedWithValue`, `_diagnosticName`, `_element`, `_finalizeContentModel`, `_isNil`, `_namespaceContext`, `_performValidation`, `_postDOMValidate`, `_postFactory_vx`, `_resetContent`, `_setAttributesFromKeywordsAndDOM`, `_setElement`, `_setIsNil`, `_setNamespaceContext`, `_setValidationConfig`, `_substitutesFor` Inherited from `utils.utility.Locatable_mixin` (private): `_location`, `_setLocation` Inherited from `datetime.datetime`: `__add__`, `__eq__`, `__ge__`, `__getattribute__`, `__gt__`, `__hash__`, `__le__`, `__lt__`, `__ne__`, `__radd__`, `__repr__`, `__rsub__`, `__str__`, `__sub__`, `astimezone`, `combine`, `ctime`, `date`, `dst`, `fromtimestamp`, `isoformat`, `now`, `replace`, `strptime`, `time`, `timetuple`, `timetz`, `tzname`, `utcfromtimestamp`, `utcnow`, `utcoffset`, `utctimetuple` Inherited from `datetime.date`: `__format__`, `fromordinal`, `isocalendar`, `isoweekday`, `strftime`, `toordinal`, `weekday`

Class Methods | [hide private]
today(cls) Return today. | source code
Inherited from `_PyXBDateTime_base`: `XsdLiteral` Inherited from `_PyXBDateTime_base` (private): `_AdjustForTimezone`, `_LexicalToKeywords`, `_SetKeysFromPython`, `_SetKeysFromPython_csc` Inherited from `basis.simpleTypeDefinition`: `PythonLiteral`, `SimpleTypeDefinition`, `XsdConstraintsOK`, `XsdSuperType`, `XsdValueLength` Inherited from `basis.simpleTypeDefinition` (private): `_CheckValidValue`, `_ConvertArguments`, `_ConvertArguments_vx`, `_FacetMap`, `_InitializeFacetMap`, `_IsSimpleTypeContent`, `_IsValidValue`, `_SimpleTypeDefinition`, `_XsdConstraintsPreCheck_vb`, `_description` Inherited from `basis._TypeBinding_mixin`: `Factory` Inherited from `basis._TypeBinding_mixin` (private): `_CompatibleValue`, `_GetValidationConfig`, `_IsUrType`, `_Name`, `_PerformValidation`, `_PreFactory_vx`, `_RequireXSIType`, `_SetValidationConfig`, `_TypeBinding_mixin__AttributesFromDOM` Inherited from `basis._DynamicCreate_mixin` (private): `_AlternativeConstructor`, `_DynamicCreate`, `_DynamicCreate_mixin__AlternativeConstructorAttribute`, `_DynamicCreate_mixin__SupersedingClassAttribute`, `_SetAlternativeConstructor`, `_SetSupersedingClass`, `_SupersedingClass`

Static Methods | [hide private]
a new object with type S, a subtype of T |
__new__(cls, *args, **kw) | source code

Class Variables | [hide private]
| _ExpandedName = `pyxb.namespace.XMLSchema.createExpandedName('d`...`` The expanded name of the component.
| _Lexical_fmt = ``'``%Y-%m-%dT%H:%M:%S``'`` Format for the lexical representation of a date-related instance, excluding timezone.
| __CtorFields = ``(``'``year``'``,` `'``month``'``,` `'``day``'``,` `'``hour``'``,` `'``minute``'``,` `'``sec``...``
| _CF_enumeration = `<pyxb.binding.facets.CF_enumeration object a`...``
| _CF_maxExclusive = `<pyxb.binding.facets.CF_maxExclusive object`...``
| _CF_maxInclusive = `<pyxb.binding.facets.CF_maxInclusive object`...``
| _CF_minExclusive = `<pyxb.binding.facets.CF_minExclusive object`...``
| _CF_minInclusive = `<pyxb.binding.facets.CF_minInclusive object`...``
| _CF_pattern = `<pyxb.binding.facets.CF_pattern object at 0x2446`...``
| _CF_whiteSpace = `<pyxb.binding.facets.CF_whiteSpace object at `...``
| __SimpleTypeDefinition = `<pyxb.xmlschema.structures.SimpleType`...``
| _httpwww_w3_org2001XMLSchema_dateTime_FacetMap = ``{`<class 'pyxb`...``
Inherited from `_PyXBDateTime_base` (private): `_DefaultDay`, `_DefaultMonth`, `_DefaultYear`, `_LocalTimeZone`, `_PyXBDateTime_base__LexicalIntegerFields`, `_PyXBDateTime_base__LexicalREMap`, `_PyXBDateTime_base__PatternMap`, `_UTCTimeZone` Inherited from `basis.simpleTypeDefinition` (private): `_ReservedSymbols` Inherited from `basis._TypeBinding_mixin`: `_validationConfig_` Inherited from `basis._TypeBinding_mixin` (private): `_Abstract`, `_AttributeMap`, `_AttributeWildcard`, `_PyXBFactoryKeywords`, `_TypeBinding_mixin__WarnedUnassociatedElement`, `_TypeBinding_mixin__constructedWithValue`, `_TypeBinding_mixin__element`, `_TypeBinding_mixin__namespaceContext`, `_TypeBinding_mixin__xsiNil`, `_XSDLocation` Inherited from `datetime.datetime`: `max`, `min`, `resolution`

Properties | [hide private]
Inherited from `basis._TypeBinding_mixin` (private): `_validationConfig` Inherited from `datetime.datetime`: `hour`, `microsecond`, `minute`, `second`, `tzinfo` Inherited from `datetime.date`: `day`, `month`, `year`

Method Details | [hide private]

### __new__(cls, *args, **kw) Static Method | source code
Returns: a new object with type S, a subtype of T Overrides: datetime.date.__new__ (inherited documentation)

### today(cls) Class Method | source code
Return today. Just like datetime.datetime.today(), except this one sets a tzinfo field so it's clear the value is UTC. Overrides: datetime.date.today

Class Variable Details | [hide private]

  ### _ExpandedName The expanded name of the component. Value:
      pyxb.namespace.XMLSchema.createExpandedName('dateTime')

  ### __CtorFields Value:
      ('year',
       'month',
       'day',
       'hour',
       'minute',
       'second',
       'microsecond',
       'tzinfo')

  ### _CF_enumeration Value:
      <pyxb.binding.facets.CF_enumeration object at 0x2446a90>

  ### _CF_maxExclusive Value:
      <pyxb.binding.facets.CF_maxExclusive object at 0x2446a10>

  ### _CF_maxInclusive Value:
      <pyxb.binding.facets.CF_maxInclusive object at 0x2446b10>

  ### _CF_minExclusive Value:
      <pyxb.binding.facets.CF_minExclusive object at 0x2446a50>

  ### _CF_minInclusive Value:
      <pyxb.binding.facets.CF_minInclusive object at 0x24469d0>

  ### _CF_pattern Value:
      <pyxb.binding.facets.CF_pattern object at 0x2446910>

  ### _CF_whiteSpace Value:
      <pyxb.binding.facets.CF_whiteSpace object at 0x2446ad0>

  ### __SimpleTypeDefinition Value:
      <pyxb.xmlschema.structures.SimpleTypeDefinition object at 0x288d550>

  ### _httpwww_w3_org2001XMLSchema_dateTime_FacetMap Value:
      {<class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pat
      tern object at 0x2446910>,
       <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF
      _enumeration object at 0x2446a90>,
       <class 'pyxb.binding.facets.CF_maxInclusive'>: <pyxb.binding.facets.C
      F_maxInclusive object at 0x2446b10>,
       <class 'pyxb.binding.facets.CF_minExclusive'>: <pyxb.binding.facets.C
      F_minExclusive object at 0x2446a50>,
      ...