Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to use datetime to tell your age in python

today_date = datetime.datetime.now()
dob = datetime.datetime(1982, 5, 20)
print(today_date - dob)
Comment

PREVIOUS NEXT
Code Example
Python :: check version numpy 
Python :: Savefig cuts off title 
Python :: robot append to list with for loop 
Python :: make each element in a list occur once python 
Python :: python split a string by tab 
Python :: convert time zone pandas 
Python :: waitkey in opencv 
Python :: is root node an internal node 
Python :: pyhton find dates in weeks 
Python :: python check if value is undefined 
Python :: create list in range 
Python :: python format to print dec oct hex and bin 
Python :: python code to wait 
Python :: add empty column to dataframe pandas 
Python :: managing media in django 
Python :: python scatterplot 
Python :: intersection of dataframes based on column 
Python :: powershell to python converter 
Python :: suppress warning jupyter notebook 
Python :: python convert int to bool 
Python :: python check if variables are the same 
Python :: python google search results 
Python :: remove jupyter environment 
Python :: python comprehension with sum 
Python :: python test if string is int 
Python :: f string decimal places 
Python :: boston dataset sklearn 
Python :: telnet via jump host using python 
Python :: python for loop backwards 
Python :: python loop through array backwards 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =