Skip to content

Files

Latest commit

 

History

History

Run-Script-At-a-Particular-Time

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

DateTime

The datetime module supplies classes for manipulating dates and times. for ex: to Import the datetime module and display the current date:

import datetime x = datetime.datetime.now() print(x) When we execute the code from the example above the result will be:

2021-01-14 23:14:32.037299 The date contains year, month, day, hour, minute, second, and microsecond.

method for saving it as a different file once code is executed: The datetime object has a method for formatting date objects into readable strings. The method is called strftime(), and takes one parameter, format, to specify the format of the returned string:

Setup instructions

actually we have used datetime library of python so if its not installed previously please run command pip install DateTime in terminal Now simply run the code and set the output in the newly formed file with the name as current date .

Output

the output file is formed with the name of current date and time and the content of file as per script of code.

Author(s)

vaishnavi jha