6

I am wondering when I set something like this

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

I am setting it for 5:00am. Is this 5:00am server time or UTC time?

3 Answers 3

4

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

Edit: actually it looks like it has used both! Versions prior to 0.9 used local time, those after use UTC (source), so it should be UTC as long as you are using a recent version.

Sign up to request clarification or add additional context in comments.

2 Comments

can't find any mention of UTC or local time in the migration guide mentioned above...maybe Quartz.Net moved the doc?
@w4ik yes they seem to have moved their docs, will see if I can find another copy
4

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

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

1 Comment

Funny, I did not know about MakeDailyTrigger, so I ended up with string.format code exactly as above. I wish Quartz had better documentation.
1

I believe that when you enter an hour in the hour argument in the MakeDailyTrigger method that Quartz.Net is expecting local time...Internally Quartz.net converts this time to UTC, but if you enter 5 in the hour argument the trigger will fire at 5AM local time.

Try this

 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 Comment

Just FYI, Quartz.net 2.0.1 does not support UTC time, but this was fixed in 2.1.0. I learned this the hard way.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.