Some of Time Functions are discussed in Set 1
Date manipulation can also be performed using Python using “datetime” module and using “date” class in it.
Operations on Date :
1. MINYEAR :- It displays the minimum year that can be represented using date class.
2. MAXYEAR :- It displays the maximum year that can be represented using date class.
Minimum representable year is : 1 Maximum representable year is : 9999
3. date(yyyy-mm-dd) :- This function returns a string with passed arguments in order of year, months and date.
4. today() :- Returns the date of present day in the format yyyy-mm-dd.
The represented date is : 1997-04-01 Present date is : 2016-08-02
5. fromtimestamp(sec) :- It returns the date calculated from the seconds elapsed since epoch mentioned in arguments.
6. min() :- This returns the minimum date that can be represented by date class.
7. max() :- This returns the maximum date that can be represented by date class.
The calculated date from seconds is : 1970-02-09 Minimum representable date is : 0001-01-01 Maximum representable date is : 9999-12-31
This article is contributed by Manjeet Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- String manipulations in Pandas DataFrame
- Time Functions in Python | Set 1 (time(), ctime(), sleep()...)
- Mathematical Functions in Python | Set 1 (Numeric Functions)
- Mathematical Functions in Python | Set 2 (Logarithmic and Power Functions)
- Mathematical Functions in Python | Set 3 (Trigonometric and Angular Functions)
- Mathematical Functions in Python | Set 4 (Special Functions and Constants)
- Date after adding given number of days to the given date
- How to print date starting from the given date for n number of days using Pandas?
- Time difference between expected time and given time
- Python | Working with date and time using Pandas
- Get Current Date and Time using Python
- Display date and time in videos using OpenCV - Python
- Python Tweepy – Getting the date and time when a tweet was tweeted
- C++ Program to print current Day, Date and Time
- Java | Current date and time
- Convert timestamp to readable date/time in PHP
- Date and time fields in serializers - Django REST Framework
- PyQt5 QDateEdit - Setting Date Time
- PyQt5 QDateEdit - Getting Date Time
- PyQt5 QDateEdit - Date Time Changed Signal