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
- Python | Scramble words from a text file
- Python program to extract Email-id from URL text file
- 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
- Python | Create and write on excel file using xlsxwriter module
- Python | Create a stopwatch using clock object in kivy using .kv file
- reStructuredText | .rst file to HTML file using Python for Documentations
- Python | Find current weather of any city using openweathermap API
- numpy.empty() in Python
- Python | First Non-Empty String in list
- Python | Check whether a list is empty or not
- Python | Pandas DataFrame.empty
- Python | Check if dictionary is empty
- Python | Convert None to empty string
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.