0

I have this:

    app.get('/createThePayment', async (req, res) => {
    
    let month = new Date();
    if (month == 0) {
        month = 12
    }
    createPaymentIntentTwo(req, res, month)

})

but what I want to do is actually run this:

let month = new Date();
    if (month == 0) {
        month = 12
    }
    createPaymentIntentTwo(req, res, month)

at every first day of the month, but I cant seem to figure it out with cronjob.

var PaymentCron = new CronJob('0 0 0 * * *', function() {

something in this format?

devdude19289
  • 151
  • 1
  • 10

0 Answers0