What time do I go to Quartz.net?

I am wondering when I install something like this

Trigger trigger = TriggerUtils.MakeDailyTrigger("abc", 5, 00); 

I set it to 5:00. Is it 5:00 server time or UTC time?

+6
source share
3 answers

It uses UTC time, however this is not correctly documented .

Edit : It actually looks like he used both! Versions before 0.9 used local time after using UTC ( source ), so it should be UTC while you are using the latest version.

+4
source

5:00 UTC time. The open Quartz.NET API always expects times in UTC. Just FYI, MakeDailyTrigger is just a shortcut to CronTrigger with the following format:

 string.Format("0 {0} {1} ? * *", minute, hour) 
+4
source

I believe that when you enter the hour in the hour argument in the MakeDailyTrigger method, which Quartz.Net expects local time ... Internally Quartz.net converts this time to UTC, but if you enter 5 in the hour argument, the trigger fires at 5 am local time.

try it

  Trigger trigger = TriggerUtils.MakeDailyTrigger("trigger",5,0); var ttimes = TriggerUtils.ComputeFireTimes(trigger, null, 1); foreach (DateTime ttime in ttimes) { Console.WriteLine(ttime); 'ttime is in UTC - so for EST, ttime.Hour would be 10AM 'however ttime.ToLocalTime().Hour would be 5AM } 
+1
source

Source: https://habr.com/ru/post/897713/


All Articles