简体   繁体   中英

How do I update my old date in every 14 days automatically to show 14 days of income in Node.js?

This is my little bit code

  const seller = await Seller.findOne({seller: req.seller.id});
  const joinUpdate = seller.createdAt
  const nowDate = new Date(joinUpdate);
  const Month = new Date(nowDate.setDate(nowDate.getDate() + 14));
  console.log(nowDate.toLocaleString())

You can write cronjobs to schedule tasks. Explore here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM