Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Module « datetime » Python 3.13.2

Classe « datetime »

Informations générales

Héritage

builtins.object
    date
        datetime

Définition

class datetime(date):

help(datetime)

datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

The year, month and day arguments are required. tzinfo may be None, or an
instance of a tzinfo subclass. The remaining arguments may be ints.

Constructeur(s)

Signature du constructeur Description
__new__(*args, **kwargs) Create and return a new object. See help(type) for accurate signature. [extrait de __new__.__doc__]
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des attributs statiques

Nom de l'attribut Valeur
fold<attribute 'fold' of 'datetime.datetime' objects>
hour<attribute 'hour' of 'datetime.datetime' objects>
max9999-12-31 23:59:59.999999
microsecond<attribute 'microsecond' of 'datetime.datetime' objects>
min0001-01-01 00:00:00
minute<attribute 'minute' of 'datetime.datetime' objects>
resolution0:00:00.000001
second<attribute 'second' of 'datetime.datetime' objects>
tzinfo<attribute 'tzinfo' of 'datetime.datetime' objects>

Attributs statiques hérités de la classe date

day, month, year

Liste des opérateurs

Signature de l'opérateur Description
__add__(self, value) Return self+value. [extrait de __add__.__doc__]
__eq__(self, value) Return self==value. [extrait de __eq__.__doc__]
__ge__(self, value) Return self>=value. [extrait de __ge__.__doc__]
__gt__(self, value) Return self>value. [extrait de __gt__.__doc__]
__le__(self, value) Return self<=value. [extrait de __le__.__doc__]
__lt__(self, value) Return self<value. [extrait de __lt__.__doc__]
__ne__(self, value) Return self!=value. [extrait de __ne__.__doc__]
__radd__(self, value) Return value+self. [extrait de __radd__.__doc__]
__rsub__(self, value) Return value-self. [extrait de __rsub__.__doc__]
__sub__(self, value) Return self-value. [extrait de __sub__.__doc__]

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__hash__(self) Return hash(self). [extrait de __hash__.__doc__]
__reduce__(self) __reduce__() -> (cls, state) [extrait de __reduce__.__doc__]
__reduce_ex__ __reduce_ex__(proto) -> (cls, state) [extrait de __reduce_ex__.__doc__]
__replace__(self, /, **changes) The same as replace(). [extrait de __replace__.__doc__]
__repr__(self) Return repr(self). [extrait de __repr__.__doc__]
__str__(self) Return str(self). [extrait de __str__.__doc__]
astimezone tz -> convert to local time in new timezone tz [extrait de astimezone.__doc__]
combine date, time -> datetime with same date and time fields [extrait de combine.__doc__]
ctime(self) Return ctime() style string. [extrait de ctime.__doc__]
date(self) Return date object with same year, month and day. [extrait de date.__doc__]
dst(self) Return self.tzinfo.dst(self). [extrait de dst.__doc__]
fromisocalendar int, int, int -> Construct a date from the ISO year, week number and weekday. [extrait de fromisocalendar.__doc__]
fromisoformat(object) string -> datetime from a string in most ISO 8601 formats [extrait de fromisoformat.__doc__]
fromordinal int -> date corresponding to a proleptic Gregorian ordinal. [extrait de fromordinal.__doc__]
fromtimestamp timestamp[, tz] -> tz's local time from POSIX timestamp. [extrait de fromtimestamp.__doc__]
isoformat [sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. [extrait de isoformat.__doc__]
now(tz=None) Returns new datetime object representing current time local to tz. [extrait de now.__doc__]
replace Return datetime with new specified fields. [extrait de replace.__doc__]
strptime string, format -> new datetime parsed from a string (like time.strptime()). [extrait de strptime.__doc__]
time(self) Return time object with same time but with tzinfo=None. [extrait de time.__doc__]
timestamp(self) Return POSIX timestamp as float. [extrait de timestamp.__doc__]
timetuple(self) Return time tuple, compatible with time.localtime(). [extrait de timetuple.__doc__]
timetz(self) Return time object with same time and tzinfo. [extrait de timetz.__doc__]
today() Current date or datetime: same as self.__class__.fromtimestamp(time.time()). [extrait de today.__doc__]
tzname(self) Return self.tzinfo.tzname(self). [extrait de tzname.__doc__]
utcfromtimestamp Construct a naive UTC datetime from a POSIX timestamp. [extrait de utcfromtimestamp.__doc__]
utcnow() Return a new datetime representing UTC day and time. [extrait de utcnow.__doc__]
utcoffset(self) Return self.tzinfo.utcoffset(self). [extrait de utcoffset.__doc__]
utctimetuple(self) Return UTC time tuple, compatible with time.localtime(). [extrait de utctimetuple.__doc__]

Méthodes héritées de la classe date

__format__, __init_subclass__, __subclasshook__, isocalendar, isoweekday, strftime, toordinal, weekday

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __init_subclass__, __setattr__, __sizeof__, __subclasshook__

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé