Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quartz .NET MakeDailyTrigger

Tags:

quartz.net

I am using Quartz framework, got bit confused with time generation. This is a simple code which generates daily trigger @ 11:30 am. To test this out, i generated next 100 consecutive firing time using ComputeFireTimes query but time i get is wierd. May be i m missing something here.

        Trigger trig = TriggerUtils.MakeDailyTrigger(11, 30);
        var triggerList = TriggerUtils.ComputeFireTimes(trig, null, 100);
        foreach (DateTime trigger in triggerList)
        {
            Console.WriteLine(trigger.ToString());
        }

The output i get is

8/12/2011 3:30:00 PM 8/13/2011 3:30:00 PM 8/14/2011 3:30:00 PM 8/15/2011 3:30:00 PM 8/16/2011 3:30:00 PM 8/17/2011 3:30:00 PM 8/18/2011 3:30:00 PM 8/19/2011 3:30:00 PM

The time should have been 11:30 a.m. but it is showing 3:30 pm.

like image 426
GammaVega Avatar asked Aug 11 '11 16:08

GammaVega


1 Answers

These are UTC (GMT) times, maybe your time zone is 4 hours different from UTC? You would need to change the display to your local time zone by calling Console.WriteLine(trigger.ToLocalTime().ToString());

like image 155
Marko Lahma Avatar answered Nov 03 '22 19:11

Marko Lahma