from datetime import date
dt = date.today().resolution
print(dt)
Output
1 day, 0:00:00
Date with time
from datetime import datetime
dt = datetime.now().resolution
print(dt)
Output
0:00:00.000001
import datetime
# Year, Month, date, Hour, Minute, Second, microsecond
dt = datetime.datetime(2019,12,31,23,59,59,345234)
print(dt.resolution)
Output
0:00:00.000001
from datetime import datetime
resolution = datetime.now().resolution
print(resolution) # Output: 0:00:00.000001 (microseconds)
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.