DateBuilder is used to conveniently create
DateTimeOffset instances that meet particular criteria.
Inheritance Hierarchy
QuartzDateBuilder
Namespace: Quartz
Assembly: Quartz (in Quartz.dll) Version: 3.0.0
Syntax
C#
public class DateBuilder
The DateBuilder type exposes the following members.
Methods
Name | Description | |
---|---|---|
AtHourMinuteAndSecond | ||
AtHourOfDay |
Set the hour (0-23) for the Date that will be built by this builder.
| |
AtMinute |
Set the minute (0-59) for the Date that will be built by this builder.
| |
AtSecond |
Set the second (0-59) for the Date that will be built by this builder, and truncate the milliseconds to 000.
| |
Build |
Build the DateTimeOffset defined by this builder instance.
| |
DateOf(Int32, Int32, Int32) |
Get a DateTimeOffset object that represents the given time, on today's date.
| |
DateOf(Int32, Int32, Int32, Int32, Int32) |
Get a DateTimeOffset object that represents the given time, on the
given date.
| |
DateOf(Int32, Int32, Int32, Int32, Int32, Int32) |
Get a DateTimeOffset object that represents the given time, on the
given date.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
EvenHourDate |
Returns a date that is rounded to the next even hour above the given date.
| |
EvenHourDateAfterNow |
Returns a date that is rounded to the next even hour after the current time.
| |
EvenHourDateBefore |
Returns a date that is rounded to the previous even hour below the given date.
| |
EvenMinuteDate |
Returns a date that is rounded to the next even minute above the given date.
| |
EvenMinuteDateAfterNow | Returns a date that is rounded to the next even minute after the current time. | |
EvenMinuteDateBefore |
Returns a date that is rounded to the previous even minute below the given date.
| |
EvenSecondDate |
Returns a date that is rounded to the next even second above the given date.
| |
EvenSecondDateAfterNow |
Returns a date that is rounded to the next even second after the current time.
| |
EvenSecondDateBefore |
Returns a date that is rounded to the previous even second below the
given date.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FutureDate | ||
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InMonth |
Set the month (1-12) for the Date that will be built by this builder.
| |
InMonthOnDay | ||
InTimeZone |
Set the TimeZoneInfo for the Date that will be built by this builder (if "null", system default will be used)
| |
InYear |
Set the year for the Date that will be built by this builder.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
NewDate |
Create a DateBuilder, with initial settings for the current date and time in the system default timezone.
| |
NewDateInTimeZone |
Create a DateBuilder, with initial settings for the current date and time in the given timezone.
| |
NextGivenMinuteDate |
Returns a date that is rounded to the next even multiple of the given
minute.
| |
NextGivenSecondDate |
Returns a date that is rounded to the next even multiple of the given
minute.
| |
OnDay |
Set the day of month (1-31) for the Date that will be built by this builder.
| |
TodayAt |
Get a DateTimeOffset object that represents the given time, on
today's date (equivalent to DateOf(Int32, Int32, Int32)).
| |
TomorrowAt |
Get a DateTimeOffset object that represents the given time, on
tomorrow's date.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
ValidateDayOfMonth | ||
ValidateHour | ||
ValidateMinute | ||
ValidateMonth | ||
ValidateSecond | ||
ValidateYear |
Remarks
Quartz provides a builder-style API for constructing scheduling-related entities via a Domain-Specific Language (DSL). The DSL can best be utilized through the usage of static imports of the methods on the classes TriggerBuilder, JobBuilder, DateBuilder, JobKey, TriggerKey and the various IScheduleBuilder implementations.
Client code can then use the DSL to write code such as this:
IJobDetail job = JobBuilder.Create<MyJob>() .WithIdentity("myJob") .Build(); ITrigger trigger = newTrigger() .WithIdentity(triggerKey("myTrigger", "myTriggerGroup")) .WithSimpleSchedule(x => x .WithIntervalInHours(1) .RepeatForever()) .StartAt(DateBuilder.FutureDate(10, IntervalUnit.Minutes)) .Build(); scheduler.scheduleJob(job, trigger);
See Also