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

Class datetime

source code

object --+    
         |    
      date --+
             |
            datetime

datetime(year, month, day, [hour, [minute, [seconds, [microsecond, [tzinfo]]]]]) --> datetime object

Instance Methods [hide private]
 
time(self)
Return time object with same time but with tzinfo=None.
source code
 
date(self)
Return date object with same year, month and day.
source code
 
__init__(self, year, month, day, hour=None, minute=None, second=None, microsecond=None, tzinfo=None)
date(year, month, day) --> date object
source code
 
__repr__(self)
repr(x)
source code
 
replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=None)
Return datetime with new specified fields.
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
 
__hash__(x)
hash(x)
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
 
togregorian(self)
Convert current jalali date to gregorian and return datetime.datetime
source code
 
astimezone(self, tz)
tz -> convert to local time in new timezone tz
source code
 
ctime(self)
Return ctime() style string.
source code
 
dst(self)
Return self.tzinfo.dst(self)
source code
 
isoformat(self)
[sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].
source code
 
timetuple(self)
Return time tuple, compatible with time.localtime().
source code
 
timetz(self)
Return time object with same time and tzinfo.
source code
 
tzname(self)
Return self.tzinfo.tzname(self)
source code
 
utcoffset(self)
Return self.tzinfo.utcoffset(self).
source code
 
utctimetuple(self)
Return UTC time tuple, compatible with time.localtime().
source code
 
__str__(self)
str(x)
source code

Inherited from date: isleap, isocalendar, isoweekday, strftime, toordinal, weekday, weeknumber, yday

Inherited from date (private): _check_arg

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

Static Methods [hide private]
 
today()
Current date or datetime
source code
 
now(tz=None)
[tz] -> new datetime with tz's local day and time.
source code
 
utcnow()
Return a new datetime representing UTC day and time.
source code
 
fromtimestamp(timestamp, tz=None)
timestamp[, tz] -> tz's local time from POSIX timestamp.
source code
 
utcfromtimestamp(timestamp)
timestamp -> UTC datetime from a POSIX timestamp (like time.time()).
source code
 
combine(d=None, t=None, **kw)
date, time -> datetime with same date and time fields
source code
 
fromordinal(ordinal)
int -> date corresponding to a proleptic Jalali ordinal.
source code
 
strptime(date_string, format)
string, format -> new datetime parsed from a string (like time.strptime())
source code
 
fromgregorian(**kw)
Convert gregorian to jalali and return jdatetime.datetime jdatetime.date.fromgregorian(day=X,month=X,year=X,[hour=X, [minute=X, [second=X, [tzinfo=X]]]]) jdatetime.date.fromgregorian(date=datetime.date) jdatetime.date.fromgregorian(datetime=datetime.datetime)
source code
Class Variables [hide private]
  __time = None

Inherited from date: j_months, j_months_short, j_weekdays, j_weekdays_short, resolution

Properties [hide private]
  hour
  minute
  second
  microsecond
  tzinfo

Inherited from date: day, month, year

Inherited from object: __class__

Method Details [hide private]

__init__(self, year, month, day, hour=None, minute=None, second=None, microsecond=None, tzinfo=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

today()
Static Method

source code 

Current date or datetime

Overrides: date.today

fromtimestamp(timestamp, tz=None)
Static Method

source code 

timestamp[, tz] -> tz's local time from POSIX timestamp.

Overrides: date.fromtimestamp

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

Overrides: date.fromordinal

replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=None)

source code 

Return datetime with new specified fields.

Overrides: date.replace

__add__(x, y)
(Addition operator)

source code 

x+y

Overrides: date.__add__

__sub__(x, y)
(Subtraction operator)

source code 

x-y

Overrides: date.__sub__

__eq__(x, y)
(Equality operator)

source code 

x==y

Overrides: date.__eq__

__ge__(x, y)
(Greater-than-or-equals operator)

source code 

x>=y

Overrides: date.__ge__

__gt__(x, y)
(Greater-than operator)

source code 

x>y

Overrides: date.__gt__

__hash__(x)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__

__le__(x, y)
(Less-than-or-equals operator)

source code 

x<=y

Overrides: date.__le__

__lt__(x, y)
(Less-than operator)

source code 

x<y

Overrides: date.__lt__

__ne__(x, y)

source code 

x!=y

Overrides: date.__ne__

__radd__(x, y)
(Right-side addition operator)

source code 

y+x

Overrides: date.__radd__

__rsub__(x, y)

source code 

y-x

Overrides: date.__rsub__

fromgregorian(**kw)
Static Method

source code 

Convert gregorian to jalali and return jdatetime.datetime jdatetime.date.fromgregorian(day=X,month=X,year=X,[hour=X, [minute=X, [second=X, [tzinfo=X]]]]) jdatetime.date.fromgregorian(date=datetime.date) jdatetime.date.fromgregorian(datetime=datetime.datetime)

Overrides: date.fromgregorian

togregorian(self)

source code 

Convert current jalali date to gregorian and return datetime.datetime

Overrides: date.togregorian

ctime(self)

source code 

Return ctime() style string.

Overrides: date.ctime

isoformat(self)

source code 

[sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].

Overrides: date.isoformat

timetuple(self)

source code 

Return time tuple, compatible with time.localtime(). It returns Gregorian object!

utctimetuple(self)

source code 

Return UTC time tuple, compatible with time.localtime(). It returns Gregorian object !

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

hour

Get Method:
unreachable.hour(self)

minute

Get Method:
unreachable.minute(self)

second

Get Method:
unreachable.second(self)

microsecond

Get Method:
unreachable.microsecond(self)

tzinfo

Get Method:
unreachable.tzinfo(self)