0
一个cronjob时语法如"* * * * * *"
其次cron npm如何使用nodejs将常规时间转换为cronjob时间?
我想从"2017-05-09T01:30:00.123Z"
转换时间cron作业时间格式。有库或方法可以实现它吗?
一个cronjob时语法如"* * * * * *"
其次cron npm如何使用nodejs将常规时间转换为cronjob时间?
我想从"2017-05-09T01:30:00.123Z"
转换时间cron作业时间格式。有库或方法可以实现它吗?
I don't know if there is any library for it or not.
But you can simply implement it using simple date functions.
var date=new Date("2017-05-09T01:30:00.123Z");
var mins=date.getMinutes();
//mins variable for the 1st * and so on
var secs=date.getSeconds();
var dayofmonth=date.getDate();
var month=date.getMonth();
var dayofweek=date.getDay();
You can then build a string and use those values in the cron module.