cron icon indicating copy to clipboard operation
cron copied to clipboard

How to get current schedule time in each triggered job?

Open chenyahui opened this issue 3 years ago • 2 comments

How to get current schedule time in each triggered job? Such as

cron.AddFunc("1 * * * *", func(scheduleTime time.Time){

})

chenyahui avatar Nov 30 '20 07:11 chenyahui

Do you wan't to get the current time? Then just use time.Now(). This will return the current local time.

skowrons avatar Feb 21 '21 18:02 skowrons

but scheduleTime.UnixNano() maybe differ than time.Now().UnixNano()。sometime get current schedule time in each triggered jon is useful.

qianxiansheng90 avatar Oct 20 '22 13:10 qianxiansheng90