<jupyter_start><jupyter_text>> datetime A python library to deal with date & time.<jupyter_code>import datetime  
#All methods and properties
dir(datetime)
#checking present time
from datetime import datetime 
time_now = datetime.now() #(year, month, day, hour, minute, second, microsecond)
time_now
time_now.year
time_now.month
time_now.day
time_now.hour
time_now.minute
time_now.second
time_now.microsecond
time_now.timestamp() #seconds since epoch(January 1, 1970 UTC)
datetime.now().timestamp()
time_now.strftime("%H:%M:%S")
time_now.strftime("%m/%d/%Y, %H:%M:%S")
time_now.strftime("%d/%m/%Y, %H:%M:%S")
time_now.strftime("%Y/%m/%d, %H:%M:%S")
date_in_str = '21 August, 2020'
datetime.strptime(date_in_str,'%d %B, %Y')
from datetime import date,time
date.today()
Independence_day = date(1947,8,15)
Independence_day
Independence_day.year
Independence_day.day
Independence_day.month
time_check = time(12,45,59)
time_check
time_check.hour
time_check.minute
time_check.second
time_check.microsecond
#Measure time difference

start = datetime.now()

for i in range(1000):
    pass
end = datetime.now()

print('timetaken =',(end-start))<jupyter_output>timetaken = 0:00:00.000166
{'fraction_non_alphanumeric': 0.14103653355989804, 'fraction_numerical': 0.03313508920985556, 'mean_word_length': 6.95945945945946, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '364527', 'license': 'MIT', 'n_tokens_mistral': 474, 'n_tokens_neox': 427, 'n_words': 95, 'path': 'PyDay06.ipynb', 'repo_name': 'Ankita484848/pytraining', 'size': '1177'}