how to create file according to date how to create file according to date express express

how to create file according to date


One option would be to name your logfile like this:

var now = new Date();var logfile_name = './LOG/BALDate-Info-' + now.getFullYear() + "-"+ now.getMonth() + "-" + now.getDate() +'.txt'

your file should look like './LOG/BALDate-Info-2018-4-12.txt'