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

Class Date

source code

Known Subclasses:

An XML date object. Supported formats:

Instance Methods [hide private]
 
__init__(self, date) source code
int
year(self)
Get the year component.
source code
int
month(self)
Get the month component.
source code
int
day(self)
Get the day component.
source code
date
__parse(self, s)
Parse the string date.
source code
 
__str__(self) source code
 
__unicode__(self) source code
Instance Variables [hide private]
datetime.date date
The object value.
Method Details [hide private]

__init__(self, date)
(Constructor)

source code 
Parameters:
  • date ((date|str)) - The value of the object.
Raises:
  • ValueError - When date is invalid.

year(self)

source code 

Get the year component.

Returns: int
The year.

month(self)

source code 

Get the month component.

Returns: int
The month.

day(self)

source code 

Get the day component.

Returns: int
The day.

__parse(self, s)

source code 

Parse the string date. Supported formats:

  • YYYY-MM-DD
  • YYYY-MM-DD(z|Z)
  • YYYY-MM-DD+06:00
  • YYYY-MM-DD-06:00

Although, the TZ is ignored because it's meaningless without the time, right?

Parameters:
  • s (str) - A date string.
Returns: date
A date object.