Package suds :: Package sax :: Module date :: Class Time
[hide private]
[frames] | no frames]

Class Time

source code

Known Subclasses:

An XML time object. Supported formats:

Instance Methods [hide private]
 
__init__(self, time, adjusted=True) source code
int
hour(self)
Get the hour component.
source code
int
minute(self)
Get the minute component.
source code
int
second(self)
Get the seconds component.
source code
int
microsecond(self)
Get the microsecond component.
source code
 
__adjust(self)
Adjust for TZ offset.
source code
datetime.time
__parse(self, s)
Parse the string date.
source code
tuple.
__second(self, s)
Parse the seconds and microseconds.
source code
str
__offset(self, s)
Parse the TZ offset.
source code
 
__str__(self) source code
 
__unicode__(self) source code
Instance Variables [hide private]
datetime.time date
The object value.
Timezone tz
The timezone
Method Details [hide private]

__init__(self, time, adjusted=True)
(Constructor)

source code 
Parameters:
  • time ((time|str)) - The value of the object.
  • adjusted (boolean) - Adjust for local Timezone.
Raises:
  • ValueError - When time is invalid.

hour(self)

source code 

Get the hour component.

Returns: int
The hour.

minute(self)

source code 

Get the minute component.

Returns: int
The minute.

second(self)

source code 

Get the seconds component.

Returns: int
The seconds.

microsecond(self)

source code 

Get the microsecond component.

Returns: int
The microsecond.

__parse(self, s)

source code 

Parse the string date. Patterns:

  • HH:MI:SS
  • HH:MI:SS(z|Z)
  • HH:MI:SS.ms
  • HH:MI:SS.ms(z|Z)
  • HH:MI:SS(+|-)06:00
  • HH:MI:SS.ms(+|-)06:00
Parameters:
  • s (str) - A time string.
Returns: datetime.time
A time object.

__second(self, s)

source code 

Parse the seconds and microseconds. The microseconds are truncated to 999999 due to a restriction in the python datetime.datetime object.

Parameters:
  • s (str) - A string representation of the seconds.
Returns: tuple.
Tuple of (sec,ms)

__offset(self, s)

source code 

Parse the TZ offset.

Parameters:
  • s (str) - A string representation of the TZ offset.
Returns: str
The signed offset in hours.