Skip to content
Advertisement

Saving a csv with current date and time

I am running some code and I would like to save a csv file which include the current date and time in its name. For example: I run some code now (12:24, Jan 15) and I would like to have something like

JavaScript

Can you tell me how to print/save this information, please?

Advertisement

Answer

Here is the code according to your question :

JavaScript

in filename you have to write your file name the output of this will be shown as

JavaScript
Advertisement