Rahul Banerjee

#Day8 - Datetime CheatSheet in Python

#Day8 - Datetime CheatSheet in Python

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

Today we will be discussing the common operations using the Datetime Library in Python

1. Get Current Datetime

image.png

2. Datetime to a string in the desired format

image.png

Check out this resource more for examples

3. String to Datetime

image.png

4. Getting Week Number from the Date time object

image.png

5. Arithmetic with Datetime

image.png

6. Get all the days in a year

image.png

7. Get all the dates of all Mondays in a year

image.png

8 . Datetime comparison

image.png

9. Difference b/w datetime objects

image.png

10. Timezones

image.png

#python#programming-languages#100daysofcode#codenewbies
 
Share this