Date - Manipulation
Date - Manipulation
-----------------------------------------------------------
-date
-time
-datetime
-timedelta
-tzinfo
today=date.today(
218-1-12
print("date components",today.day,today.month,today.year
date component 12 1 218
today week day number:
mon
tue 1
wed 3
sun 6
today.weekday(
4
python current date and time
from datetime import datetime
today=datetime.now(
218-1-12 11:59:35.976715
DAtetime object
current time without date
----------------------------
t=datetime.time(datetime.now(
%a,%d %B,%y
Fri,12 January,18
if %a replaced with %A then
Friday
%C local date and time
%x local date
%X local time
1:19:18 AM
"%H%M"
13:19