Package jdatetime :: Class date
[hide private]
[frames] | no frames]

Class date

source code

object --+
         |
        date
Known Subclasses:

date(year, month, day) --> date object

Instance Methods [hide private]
 
_check_arg(self, value) source code
 
__init__(self, year, month, day)
date(year, month, day) --> date object
source code
 
isleap(self)
check if year is leap year algortim is based on http://en.wikipedia.org/wiki/Leap_year
source code
 
togregorian(self)
Convert current jalali date to gregorian and return datetime.date
source code
 
toordinal(self)
Return proleptic jalali ordinal.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__add__(x, y)
x+y
source code
 
__sub__(x, y)
x-y
source code
 
__eq__(x, y)
x==y
source code
 
__ge__(x, y)
x>=y
source code
 
__gt__(x, y)
x>y
source code
 
__le__(x, y)
x<=y
source code
 
__lt__(x, y)
x<y
source code
 
__ne__(x, y)
x!=y
source code
 
__radd__(x, y)
y+x
source code
 
__rsub__(x, y)
y-x
source code
 
__hash__(x)
hash(x)
source code
 
ctime(self)
Return ctime() style string.
source code
 
replace(self, year=0, month=0, day=0)
Return date with new specified fields.
source code
 
yday(self)
return day of year
source code
 
weekday(self)
Return the day of the week represented by the date.
source code
 
isoweekday(self)
Return the day of the week as an integer, where Shanbeh is 1 and Jomeh is 7
source code
 
weeknumber(self)
Return week number
source code
 
isocalendar(self)
Return a 3-tuple, (ISO year, ISO week number, ISO weekday).
source code
 
isoformat(self)
Return a string representing the date in ISO 8601 format, 'YYYY-MM-DD'
source code
 
strftime(self, format)
format -> strftime() style string.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
 
fromgregorian(**kw)
Convert gregorian to jalali and return jdatetime.date jdatetime.date.fromgregorian(day=X,month=X,year=X) jdatetime.date.fromgregorian(date=datetime.date)
source code
 
today()
Current date or datetime: same as self.__class__.fromtimestamp(time.time()).
source code
 
fromtimestamp(timestamp) source code
 
fromordinal(ordinal)
int -> date corresponding to a proleptic Jalali ordinal.
source code
Class Variables [hide private]
  j_months = ['Farvardin', 'Ordibehesht', 'Khordad', 'Tir', 'Mor...
  j_months_short = ['Far', 'Ord', 'Kho', 'Tir', 'Mor', 'Sha', 'M...
  j_weekdays = ['Shanbeh', 'Yekshanbeh', 'Doshanbeh', 'SehShanbe...
  j_weekdays_short = ['Sha', 'Yek', 'Dos', 'Seh', 'Cha', 'Pan', ...
  __year = 0
  __month = 0
  __day = 0
  resolution = datetime.timedelta(1)
The earliest representable date, date(MINYEAR, 1, 1)
Properties [hide private]
  year
  month
  day

Inherited from object: __class__

Method Details [hide private]

__init__(self, year, month, day)
(Constructor)

source code 

date(year, month, day) --> date object

Overrides: object.__init__

toordinal(self)

source code 

Return proleptic jalali ordinal. Farvardin 1 of year 1 which is equal to 622-3-21 of Gregorian.

fromordinal(ordinal)
Static Method

source code 

int -> date corresponding to a proleptic Jalali ordinal. it starts from Farvardin 1 of year 1, which is equal to 622-3-21 of Gregorian

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__hash__(x)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__

weekday(self)

source code 

Return the day of the week represented by the date. Shanbeh == 0 ... Jomeh == 6


Class Variable Details [hide private]

j_months

Value:
['Farvardin',
 'Ordibehesht',
 'Khordad',
 'Tir',
 'Mordad',
 'Shahrivar',
 'Mehr',
 'Aban',
...

j_months_short

Value:
['Far',
 'Ord',
 'Kho',
 'Tir',
 'Mor',
 'Sha',
 'Meh',
 'Aba',
...

j_weekdays

Value:
['Shanbeh',
 'Yekshanbeh',
 'Doshanbeh',
 'SehShanbeh',
 'Chaharshanbeh',
 'Panjshanbeh',
 'Jomeh']

j_weekdays_short

Value:
['Sha', 'Yek', 'Dos', 'Seh', 'Cha', 'Pan', 'Jom']

Property Details [hide private]

year

Get Method:
unreachable.year(self)

month

Get Method:
unreachable.month(self)

day

Get Method:
unreachable.day(self)