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

Class 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._TypeBinding_mixin: __setattr__, toDOM, toxml, validateBinding

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

Inherited from object: __delattr__, __reduce_ex__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
today(cls)
Return today.
source code

Inherited from _PyXBDateTime_base: XsdLiteral

Inherited from basis.simpleTypeDefinition: PythonLiteral, SimpleTypeDefinition, XsdConstraintsOK, XsdSuperType, XsdValueLength

Inherited from basis._TypeBinding_mixin: Factory

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 0x1a2d...
  _CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object at ...
  _httpwww_w3_org2001XMLSchema_dateTime_FacetMap = {<class 'pyxb...

Inherited from basis.simpleTypeDefinition (private): _ReservedSymbols

Inherited from datetime.datetime: max, min, resolution

Properties [hide private]

Inherited from datetime.datetime: hour, microsecond, minute, second, tzinfo

Inherited from datetime.date: day, month, year

Inherited from object: __class__

Method Details [hide private]

__new__(cls, *args, **kw)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__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 0x1a32050>

_CF_maxExclusive

Value:
<pyxb.binding.facets.CF_maxExclusive object at 0x1a32150>

_CF_maxInclusive

Value:
<pyxb.binding.facets.CF_maxInclusive object at 0x1a32190>

_CF_minExclusive

Value:
<pyxb.binding.facets.CF_minExclusive object at 0x1a32090>

_CF_minInclusive

Value:
<pyxb.binding.facets.CF_minInclusive object at 0x1a32110>

_CF_pattern

Value:
<pyxb.binding.facets.CF_pattern object at 0x1a2dfd0>

_CF_whiteSpace

Value:
<pyxb.binding.facets.CF_whiteSpace object at 0x1a320d0>

_httpwww_w3_org2001XMLSchema_dateTime_FacetMap

Value:
{<class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.C\
F_minInclusive object at 0x1a32110>,
 <class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pat\
tern object at 0x1a2dfd0>,
 <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF\
_enumeration object at 0x1a32050>,
 <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_\
whiteSpace object at 0x1a320d0>,
...