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

Class _PyXBDateTime_base

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
Known Subclasses:

Instance Methods [hide private]
 
__reduce__(self)
helper for pickle
source code

Inherited from basis.simpleTypeDefinition: __init__, pythonLiteral, xsdConstraintsOK, xsdLiteral, xsdValueLength

Inherited from basis._TypeBinding_mixin: __setattr__, toDOM, toxml, validateBinding

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_LexicalToKeywords(cls, text) source code
 
_SetKeysFromPython_csc(cls, python_value, kw, fields) source code
 
_SetKeysFromPython(cls, python_value, kw, fields) source code
 
_AdjustForTimezone(cls, kw)
Update datetime keywords to account for timezone effects.
source code
 
XsdLiteral(cls, value)
Convert from a python value to a string usable in an XML document.
source code

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

Inherited from basis._TypeBinding_mixin: Factory

Static Methods [hide private]

Inherited from basis.simpleTypeDefinition: __new__

Class Variables [hide private]
  _Lexical_fmt = None
Format for the lexical representation of a date-related instance, excluding timezone.
  __PatternMap = {'%Y': '(?P<negYear>-?)(?P<year>\d{4,})', '%m':...
  __LexicalREMap = {}
  __LexicalIntegerFields = 'year', 'month', 'day', 'hour', 'minu...
  _UTCTimeZone = pyxb.utils.utility.UTCOffsetTimeZone(0)
A datetime.tzinfo instance representing UTC.
  _LocalTimeZone = pyxb.utils.utility.LocalTimeZone()
A datetime.tzinfo instance representing the local time zone.
  _DefaultYear = 1900
  _DefaultMonth = 1
  _DefaultDay = 1
  _PyXBDateTime_base__LexicalIntegerFields = ('year', 'month', '...
  _PyXBDateTime_base__LexicalREMap = {}
  _PyXBDateTime_base__PatternMap = {'%H': '(?P<hour>\\d{2})', '%...

Inherited from basis.simpleTypeDefinition (private): _ReservedSymbols

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__reduce__(self)

source code 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

_AdjustForTimezone(cls, kw)
Class Method

source code 

Update datetime keywords to account for timezone effects.

All XML schema timezoned times are in UTC, with the time "in its timezone". If the keywords indicate a non-UTC timezone is in force, and pyxb.PreserveInputTimeZone() has not been set, adjust the values to account for the zone by subtracting the corresponding UTC offset and mark explicitly that the time is in UTC by leaving a tzinfo attribute identifying the UTC time zone.

Parameters:
  • kw - A dictionary of keywords relevant for a date or time instance. The dictionary is updated by this call.

XsdLiteral(cls, value)
Class Method

source code 

Convert from a python value to a string usable in an XML document.

This should be implemented in the subclass.

Overrides: basis.simpleTypeDefinition.XsdLiteral
(inherited documentation)

Class Variable Details [hide private]

_Lexical_fmt

Format for the lexical representation of a date-related instance, excluding timezone.

Subclasses must define this.

Value:
None

__PatternMap

Value:
{'%Y': '(?P<negYear>-?)(?P<year>\d{4,})', '%m': '(?P<month>\d{2})', '%\
d': '(?P<day>\d{2})', '%H': '(?P<hour>\d{2})', '%M': '(?P<minute>\d{2}\
)', '%S': '(?P<second>\d{2})(?P<fracsec>\.\d+)?', '%Z': '(?P<tzinfo>Z|\
[-+]\d\d:\d\d)'}

__LexicalIntegerFields

Value:
'year', 'month', 'day', 'hour', 'minute', 'second'

_PyXBDateTime_base__LexicalIntegerFields

Value:
('year', 'month', 'day', 'hour', 'minute', 'second')

_PyXBDateTime_base__PatternMap

Value:
{'%H': '(?P<hour>\\d{2})',
 '%M': '(?P<minute>\\d{2})',
 '%S': '(?P<second>\\d{2})(?P<fracsec>\\.\\d+)?',
 '%Y': '(?P<negYear>-?)(?P<year>\\d{4,})',
 '%Z': '(?P<tzinfo>Z|[-+]\\d\\d:\\d\\d)',
 '%d': '(?P<day>\\d{2})',
 '%m': '(?P<month>\\d{2})'}