In this article, we will learn how to create a text file names as the current date in it. For this, we can use now() method of datetime module.
The datetime module supplies classes for manipulating dates and times in both simple and complex ways. While date and time arithmetic is supported, the focus of the implementation is on efficient attribute extraction for output formatting and manipulation.
Let’s see a code example and try to understand it better.
01 August 2019.txt
- Create an empty file using Python
- Get current date using Python
- Get Current Date and Time using Python
- Convert Text and Text File to PDF using Python
- How to create an empty class in Python?
- Convert Text file to JSON in Python
- Saving Text, JSON, and CSV to a File in Python
- Python | Scramble words from a text file
- Extract numbers from a text file and add them using Python
- Count number of lines in a text file in Python
- Python program to extract Email-id from URL text file
- Create a Credential file using Python
- Python | Create checkbox using .kv file
- Python | Count occurrences of each word in given text file (Using dictionary)
- Python | Create Box Layout widget using .kv file
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.