Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.quartz
Class TriggerUtils

    java.lang.Object
      org.quartz.TriggerUtils

    public class TriggerUtils

extends Object

Convenience and utility methods for simplifying the construction and configuration of ``Trigger`s` and `Date`s

Author:
  James House
See Also:
  `CronTrigger`, `SimpleTrigger`

Field Summary
`static int` | `FRIDAY`
`static int` | `LAST_DAY_OF_MONTH`
`static long` | `MILLISECONDS_IN_DAY`
`static long` | `MILLISECONDS_IN_HOUR`
`static long` | `MILLISECONDS_IN_MINUTE`
`static int` | `MONDAY`
`static int` | `SATURDAY`
`static long` | `SECONDS_IN_DAY`
`static int` | `SUNDAY`
`static int` | `THURSDAY`
`static int` | `TUESDAY`
`static int` | `WEDNESDAY`

Method Summary
`static Date` | `computeEndTimeToAllowParticularNumberOfFirings(Trigger trigg, Calendar cal, int numTimes)` Compute the `Date` that is 1 second after the Nth firing of the given `Trigger`, taking the triger's associated `Calendar` into consideration.
`static List` | `computeFireTimes(Trigger trigg, Calendar cal, int numTimes)` Returns a list of Dates that are the next fire times of a `Trigger`.
`static List` | `computeFireTimesBetween(Trigger trigg, Calendar cal, Date from, Date to)` Returns a list of Dates that are the next fire times of a `Trigger` that fall within the given date range.
`static Date` | `getDateOf(int second, int minute, int hour)` Get a `Date` object that represents the given time, on today's date.
`static Date` | `getDateOf(int second, int minute, int hour, int dayOfMonth, int month)` Get a `Date` object that represents the given time, on the given date.
`static Date` | `getDateOf(int second, int minute, int hour, int dayOfMonth, int month, int year)` Get a `Date` object that represents the given time, on the given date.
`static int` | `getDSTSavings(TimeZone tz)` Deprecated. use TimeZone.getDSTSavings()
`static Date` | `getEvenHourDate(Date date)` Returns a date that is rounded to the next even hour above the given date.
`static Date` | `getEvenHourDateBefore(Date date)` Returns a date that is rounded to the previous even hour below the given date.
`static Date` | `getEvenMinuteDate(Date date)` Returns a date that is rounded to the next even minute above the given date.
`static Date` | `getEvenMinuteDateBefore(Date date)` Returns a date that is rounded to the previous even minute below the given date.
`static Date` | `getEvenSecondDate(Date date)` Returns a date that is rounded to the next even second above the given date.
`static Date` | `getEvenSecondDateBefore(Date date)` Returns a date that is rounded to the previous even second below the given date.
`static Date` | `getNextGivenMinuteDate(Date date, int minuteBase)` Returns a date that is rounded to the next even multiple of the given minute.
`static Date` | `getNextGivenSecondDate(Date date, int secondBase)` Returns a date that is rounded to the next even multiple of the given minute.
`static int` | `getOffset(long date, TimeZone tz)` Deprecated. use TimeZone.getOffset(date)
`static Trigger` | `makeDailyTrigger(int hour, int minute)` Make a trigger that will fire every day at the given time.
`static Trigger` | `makeDailyTrigger(String trigName, int hour, int minute)` Make a trigger that will fire every day at the given time.
`static Trigger` | `makeHourlyTrigger()` Make a trigger that will fire every hour, indefinitely.
`static Trigger` | `makeHourlyTrigger(int intervalInHours)` Make a trigger that will fire every N hours, indefinitely.
`static Trigger` | `makeHourlyTrigger(int intervalInHours, int repeatCount)` Make a trigger that will fire every N hours, with the given number of repeats.
`static Trigger` | `makeHourlyTrigger(String trigName)` Make a trigger that will fire every hour, indefinitely.
`static Trigger` | `makeHourlyTrigger(String trigName, int intervalInHours, int repeatCount)` Make a trigger that will fire every N hours, with the given number of repeats.
`static Trigger` | `makeImmediateTrigger(int repeatCount, long repeatInterval)` Make a trigger that will fire `repeatCount` times, waiting `repeatInterval` milliseconds between each fire.
`static Trigger` | `makeImmediateTrigger(String trigName, int repeatCount, long repeatInterval)` Make a trigger that will fire `repeatCount` times, waiting `repeatInterval` milliseconds between each fire.
`static Trigger` | `makeMinutelyTrigger()` Make a trigger that will fire every minute, indefinitely.
`static Trigger` | `makeMinutelyTrigger(int intervalInMinutes)` Make a trigger that will fire every N minutes, indefinitely.
`static Trigger` | `makeMinutelyTrigger(int intervalInMinutes, int repeatCount)` Make a trigger that will fire every N minutes, with the given number of repeats.
`static Trigger` | `makeMinutelyTrigger(String trigName)` Make a trigger that will fire every minute, indefinitely.
`static Trigger` | `makeMinutelyTrigger(String trigName, int intervalInMinutes, int repeatCount)` Make a trigger that will fire every N minutes, with the given number of repeats.
`static Trigger` | `makeMonthlyTrigger(int dayOfMonth, int hour, int minute)` Make a trigger that will fire every month at the given day and time.
`static Trigger` | `makeMonthlyTrigger(String trigName, int dayOfMonth, int hour, int minute)` Make a trigger that will fire every month at the given day and time.
`static Trigger` | `makeSecondlyTrigger()` Make a trigger that will fire every second, indefinitely.
`static Trigger` | `makeSecondlyTrigger(int intervalInSeconds)` Make a trigger that will fire every N seconds, indefinitely.
`static Trigger` | `makeSecondlyTrigger(int intervalInSeconds, int repeatCount)` Make a trigger that will fire every N seconds, with the given number of repeats.
`static Trigger` | `makeSecondlyTrigger(String trigName)` Make a trigger that will fire every second, indefinitely.
`static Trigger` | `makeSecondlyTrigger(String trigName, int intervalInSeconds, int repeatCount)` Make a trigger that will fire every N seconds, with the given number of repeats.
`static Trigger` | `makeWeeklyTrigger(int dayOfWeek, int hour, int minute)` Make a trigger that will fire every week at the given day and time.
`static Trigger` | `makeWeeklyTrigger(String trigName, int dayOfWeek, int hour, int minute)` Make a trigger that will fire every week at the given day and time.
`static void` | `setTriggerIdentity(Trigger trig, String name)` Set the given `Trigger`'s name to the given value, and its group to the default group (`Scheduler.DEFAULT_GROUP`).
`static void` | `setTriggerIdentity(Trigger trig, String name, String group)` Set the given `Trigger`'s name to the given value, and its group to the given group.
`static Date` | `translateTime(Date date, TimeZone src, TimeZone dest)` Translate a date & time from a users time zone to the another (probably server) time zone to assist in creating a simple trigger with the right date & time.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SUNDAY

    public static final int SUNDAY

See Also:
  Constant Field Values

### MONDAY

    public static final int MONDAY

See Also:
  Constant Field Values

### TUESDAY

    public static final int TUESDAY

See Also:
  Constant Field Values

### WEDNESDAY

    public static final int WEDNESDAY

See Also:
  Constant Field Values

### THURSDAY

    public static final int THURSDAY

See Also:
  Constant Field Values

### FRIDAY

    public static final int FRIDAY

See Also:
  Constant Field Values

### SATURDAY

    public static final int SATURDAY

See Also:
  Constant Field Values

### LAST_DAY_OF_MONTH

    public static final int LAST_DAY_OF_MONTH

See Also:
  Constant Field Values

### MILLISECONDS_IN_MINUTE

    public static final long MILLISECONDS_IN_MINUTE

See Also:
  Constant Field Values

### MILLISECONDS_IN_HOUR

    public static final long MILLISECONDS_IN_HOUR

See Also:
  Constant Field Values

### SECONDS_IN_DAY

    public static final long SECONDS_IN_DAY

See Also:
  Constant Field Values

### MILLISECONDS_IN_DAY

    public static final long MILLISECONDS_IN_DAY

See Also:
  Constant Field Values

Method Detail

### setTriggerIdentity

    public static void setTriggerIdentity(Trigger trig,
                                          String name)

  Set the given `Trigger`'s name to the given value, and its group to the default group (`Scheduler.DEFAULT_GROUP`).

  Parameters:
    `trig` - the trigger to change name to
    `name` - the new trigger name

### setTriggerIdentity

    public static void setTriggerIdentity(Trigger trig,
                                          String name,
                                          String group)

  Set the given `Trigger`'s name to the given value, and its group to the given group.

  Parameters:
    `trig` - the trigger to change name to
    `name` - the new trigger name
    `group` - the new trigger group

### makeDailyTrigger

    public static Trigger makeDailyTrigger(int hour,
                                           int minute)

  Make a trigger that will fire every day at the given time.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `hour` - the hour (0-23) upon which to fire
    `minute` - the minute (0-59) upon which to fire
  Returns:
    the new trigger

### makeDailyTrigger

    public static Trigger makeDailyTrigger(String trigName,
                                           int hour,
                                           int minute)

  Make a trigger that will fire every day at the given time.

  The generated trigger will not have its group or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
    `hour` - the hour (0-23) upon which to fire
    `minute` - the minute (0-59) upon which to fire
  Returns:
    the newly created trigger

### makeWeeklyTrigger

    public static Trigger makeWeeklyTrigger(int dayOfWeek,
                                            int hour,
                                            int minute)

  Make a trigger that will fire every week at the given day and time.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `dayOfWeek` - (1-7) the day of week upon which to fire
    `hour` - the hour (0-23) upon which to fire
    `minute` - the minute (0-59) upon which to fire
  Returns:
    the new trigger
  See Also:
    `SUNDAY`, `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`

### makeWeeklyTrigger

    public static Trigger makeWeeklyTrigger(String trigName,
                                            int dayOfWeek,
                                            int hour,
                                            int minute)

  Make a trigger that will fire every week at the given day and time.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
    `dayOfWeek` - (1-7) the day of week upon which to fire
    `hour` - the hour (0-23) upon which to fire
    `minute` - the minute (0-59) upon which to fire
  Returns:
    the newly created trigger
  See Also:
    `SUNDAY`, `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`

### makeMonthlyTrigger

    public static Trigger makeMonthlyTrigger(int dayOfMonth,
                                             int hour,
                                             int minute)

  Make a trigger that will fire every month at the given day and time.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  If the day of the month specified does not occur in a given month, a firing will not occur that month. (i.e. if dayOfMonth is specified as 31, no firing will occur in the months of the year with fewer than 31 days).

  Parameters:
    `dayOfMonth` - (1-31, or -1) the day of week upon which to fire
    `hour` - the hour (0-23) upon which to fire
    `minute` - the minute (0-59) upon which to fire
  Returns:
    the newly created trigger

### makeMonthlyTrigger

    public static Trigger makeMonthlyTrigger(String trigName,
                                             int dayOfMonth,
                                             int hour,
                                             int minute)

  Make a trigger that will fire every month at the given day and time.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  If the day of the month specified does not occur in a given month, a firing will not occur that month. (i.e. if dayOfMonth is specified as 31, no firing will occur in the months of the year with fewer than 31 days).

  Parameters:
    `trigName` - the trigger's name
    `dayOfMonth` - (1-31, or -1) the day of week upon which to fire
    `hour` - the hour (0-23) upon which to fire
    `minute` - the minute (0-59) upon which to fire
  Returns:
    the newly created trigger

### makeImmediateTrigger

    public static Trigger makeImmediateTrigger(int repeatCount,
                                               long repeatInterval)

  Make a trigger that will fire `repeatCount` times, waiting `repeatInterval` milliseconds between each fire.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `repeatCount` - the number of times to fire the trigger
    `repeatInterval` - the number of milliseconds to wait between fires
  Returns:
    the newly created trigger

### makeImmediateTrigger

    public static Trigger makeImmediateTrigger(String trigName,
                                               int repeatCount,
                                               long repeatInterval)

  Make a trigger that will fire `repeatCount` times, waiting `repeatInterval` milliseconds between each fire.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
    `repeatCount` - the number of times to fire the trigger
    `repeatInterval` - the number of milliseconds to wait between fires
  Returns:
    the new trigger

### makeSecondlyTrigger

    public static Trigger makeSecondlyTrigger()

  Make a trigger that will fire every second, indefinitely.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Returns:
    the new trigger

### makeSecondlyTrigger

    public static Trigger makeSecondlyTrigger(String trigName)

  Make a trigger that will fire every second, indefinitely.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
  Returns:
    the new trigger

### makeSecondlyTrigger

    public static Trigger makeSecondlyTrigger(int intervalInSeconds)

  Make a trigger that will fire every N seconds, indefinitely.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `intervalInSeconds` - the number of seconds between firings
  Returns:
    the new trigger

### makeSecondlyTrigger

    public static Trigger makeSecondlyTrigger(int intervalInSeconds,
                                              int repeatCount)

  Make a trigger that will fire every N seconds, with the given number of repeats.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `intervalInSeconds` - the number of seconds between firings
    `repeatCount` - the number of times to repeat the firing
  Returns:
    the new trigger

### makeSecondlyTrigger

    public static Trigger makeSecondlyTrigger(String trigName,
                                              int intervalInSeconds,
                                              int repeatCount)

  Make a trigger that will fire every N seconds, with the given number of repeats.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
    `intervalInSeconds` - the number of seconds between firings
    `repeatCount` - the number of times to repeat the firing
  Returns:
    the new trigger

### makeMinutelyTrigger

    public static Trigger makeMinutelyTrigger()

  Make a trigger that will fire every minute, indefinitely.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Returns:
    the new trigger

### makeMinutelyTrigger

    public static Trigger makeMinutelyTrigger(String trigName)

  Make a trigger that will fire every minute, indefinitely.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
  Returns:
    the new trigger

### makeMinutelyTrigger

    public static Trigger makeMinutelyTrigger(int intervalInMinutes)

  Make a trigger that will fire every N minutes, indefinitely.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `intervalInMinutes` - the number of minutes between firings
  Returns:
    the new trigger

### makeMinutelyTrigger

    public static Trigger makeMinutelyTrigger(int intervalInMinutes,
                                              int repeatCount)

  Make a trigger that will fire every N minutes, with the given number of repeats.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `intervalInMinutes` - the number of minutes between firings
    `repeatCount` - the number of times to repeat the firing
  Returns:
    the new trigger

### makeMinutelyTrigger

    public static Trigger makeMinutelyTrigger(String trigName,
                                              int intervalInMinutes,
                                              int repeatCount)

  Make a trigger that will fire every N minutes, with the given number of repeats.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
    `intervalInMinutes` - the number of minutes between firings
    `repeatCount` - the number of times to repeat the firing
  Returns:
    the new trigger

### makeHourlyTrigger

    public static Trigger makeHourlyTrigger()

  Make a trigger that will fire every hour, indefinitely.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Returns:
    the new trigger

### makeHourlyTrigger

    public static Trigger makeHourlyTrigger(String trigName)

  Make a trigger that will fire every hour, indefinitely.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
  Returns:
    the new trigger

### makeHourlyTrigger

    public static Trigger makeHourlyTrigger(int intervalInHours)

  Make a trigger that will fire every N hours, indefinitely.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `intervalInHours` - the number of hours between firings
  Returns:
    the new trigger

### makeHourlyTrigger

    public static Trigger makeHourlyTrigger(int intervalInHours,
                                            int repeatCount)

  Make a trigger that will fire every N hours, with the given number of repeats.

  The generated trigger will not have its name, group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `intervalInHours` - the number of hours between firings
    `repeatCount` - the number of times to repeat the firing
  Returns:
    the new trigger

### makeHourlyTrigger

    public static Trigger makeHourlyTrigger(String trigName,
                                            int intervalInHours,
                                            int repeatCount)

  Make a trigger that will fire every N hours, with the given number of repeats.

  The generated trigger will not have its group, or end-time set. The Start time defaults to 'now'.

  Parameters:
    `trigName` - the trigger's name
    `intervalInHours` - the number of hours between firings
    `repeatCount` - the number of times to repeat the firing
  Returns:
    the new trigger

### getEvenHourDate

    public static Date getEvenHourDate(Date date)

  Returns a date that is rounded to the next even hour above the given date.

  For example an input date with a time of 08:13:54 would result in a date with the time of 09:00:00. If the date's time is in the 23rd hour, the date's 'day' will be promoted, and the time will be set to 00:00:00.

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
  Returns:
    the new rounded date

### getEvenHourDateBefore

    public static Date getEvenHourDateBefore(Date date)

  Returns a date that is rounded to the previous even hour below the given date.

  For example an input date with a time of 08:13:54 would result in a date with the time of 08:00:00.

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
  Returns:
    the new rounded date

### getEvenMinuteDate

    public static Date getEvenMinuteDate(Date date)

  Returns a date that is rounded to the next even minute above the given date.

  For example an input date with a time of 08:13:54 would result in a date with the time of 08:14:00. If the date's time is in the 59th minute, then the hour (and possibly the day) will be promoted.

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
  Returns:
    the new rounded date

### getEvenMinuteDateBefore

    public static Date getEvenMinuteDateBefore(Date date)

  Returns a date that is rounded to the previous even minute below the given date.

  For example an input date with a time of 08:13:54 would result in a date with the time of 08:13:00.

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
  Returns:
    the new rounded date

### getEvenSecondDate

    public static Date getEvenSecondDate(Date date)

  Returns a date that is rounded to the next even second above the given date.

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
  Returns:
    the new rounded date

### getEvenSecondDateBefore

    public static Date getEvenSecondDateBefore(Date date)

  Returns a date that is rounded to the previous even second below the given date.

  For example an input date with a time of 08:13:54.341 would result in a date with the time of 08:13:00.000.

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
  Returns:
    the new rounded date

### getNextGivenMinuteDate

    public static Date getNextGivenMinuteDate(Date date,
                                              int minuteBase)

  Returns a date that is rounded to the next even multiple of the given minute.

  For example an input date with a time of 08:13:54, and an input minute-base of 5 would result in a date with the time of 08:15:00. The same input date with an input minute-base of 10 would result in a date with the time of 08:20:00. But a date with the time 08:53:31 and an input minute-base of 45 would result in 09:00:00, because the even-hour is the next 'base' for 45-minute intervals.

  More examples:

  Input Time | Minute-Base | Result Time
  --- | --- | ---
  11:16:41 | 20 | 11:20:00
  11:36:41 | 20 | 11:40:00
  11:46:41 | 20 | 12:00:00
  11:26:41 | 30 | 11:30:00
  11:36:41 | 30 | 12:00:00
  | 11:16:41 | 17 | 11:17:00 | 11:17:41 | 17 | 11:34:00 | 11:52:41 | 17 | 12:00:00 | 11:52:41 | 5 | 11:55:00 | 11:57:41 | 5 | 12:00:00 | 11:17:41 | 0 | 12:00:00 | 11:17:41 | 1 | 11:08:00

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
    `minuteBase` - the base-minute to set the time on
  Returns:
    the new rounded date
  See Also:
    `getNextGivenSecondDate(Date, int)`

### getNextGivenSecondDate

    public static Date getNextGivenSecondDate(Date date,
                                              int secondBase)

  Returns a date that is rounded to the next even multiple of the given minute.

  The rules for calculating the second are the same as those for calculating the minute in the method `getNextGivenMinuteDate(..)`.``

  Parameters:
    `date` - the Date to round, if `null` the current time will be used
    `secondBase` - the base-second to set the time on
  Returns:
    the new rounded date
  See Also:
    `getNextGivenMinuteDate(Date, int)`

### getDateOf

    public static Date getDateOf(int second,
                                 int minute,
                                 int hour)

  Get a `Date` object that represents the given time, on today's date.

  Parameters:
    `second` - The value (0-59) to give the seconds field of the date
    `minute` - The value (0-59) to give the minutes field of the date
    `hour` - The value (0-23) to give the hours field of the date
  Returns:
    the new date

### getDateOf

    public static Date getDateOf(int second,
                                 int minute,
                                 int hour,
                                 int dayOfMonth,
                                 int month)

  Get a `Date` object that represents the given time, on the given date.

  Parameters:
    `second` - The value (0-59) to give the seconds field of the date
    `minute` - The value (0-59) to give the minutes field of the date
    `hour` - The value (0-23) to give the hours field of the date
    `dayOfMonth` - The value (1-31) to give the day of month field of the date
    `month` - The value (1-12) to give the month field of the date
  Returns:
    the new date

### getDateOf

    public static Date getDateOf(int second,
                                 int minute,
                                 int hour,
                                 int dayOfMonth,
                                 int month,
                                 int year)

  Get a `Date` object that represents the given time, on the given date.

  Parameters:
    `second` - The value (0-59) to give the seconds field of the date
    `minute` - The value (0-59) to give the minutes field of the date
    `hour` - The value (0-23) to give the hours field of the date
    `dayOfMonth` - The value (1-31) to give the day of month field of the date
    `month` - The value (1-12) to give the month field of the date
    `year` - The value (1970-2099) to give the year field of the date
  Returns:
    the new date

### computeFireTimes

    public static List computeFireTimes(Trigger trigg,
                                        Calendar cal,
                                        int numTimes)

  Returns a list of Dates that are the next fire times of a `Trigger`. The input trigger will be cloned before any work is done, so you need not worry about its state being altered by this method.

  Parameters:
    `trigg` - The trigger upon which to do the work
    `cal` - The calendar to apply to the trigger's schedule
    `numTimes` - The number of next fire times to produce
  Returns:
    List of java.util.Date objects

### computeEndTimeToAllowParticularNumberOfFirings

    public static Date computeEndTimeToAllowParticularNumberOfFirings(Trigger trigg,
                                                                      Calendar cal,
                                                                      int numTimes)

  Compute the `Date` that is 1 second after the Nth firing of the given `Trigger`, taking the triger's associated `Calendar` into consideration. The input trigger will be cloned before any work is done, so you need not worry about its state being altered by this method.

  Parameters:
    `trigg` - The trigger upon which to do the work
    `cal` - The calendar to apply to the trigger's schedule
    `numTimes` - The number of next fire times to produce
  Returns:
    the computed Date, or null if the trigger (as configured) will not fire that many times.

### computeFireTimesBetween

    public static List computeFireTimesBetween(Trigger trigg,
                                               Calendar cal,
                                               Date from,
                                               Date to)

  Returns a list of Dates that are the next fire times of a `Trigger` that fall within the given date range. The input trigger will be cloned before any work is done, so you need not worry about its state being altered by this method.

  NOTE: if this is a trigger that has previously fired within the given date range, then firings which have already occurred will not be listed in the output List.

  Parameters:
    `trigg` - The trigger upon which to do the work
    `cal` - The calendar to apply to the trigger's schedule
    `from` - The starting date at which to find fire times
    `to` - The ending date at which to stop finding fire times
  Returns:
    List of java.util.Date objects

### translateTime

    public static Date translateTime(Date date,
                                     TimeZone src,
                                     TimeZone dest)

  Translate a date & time from a users time zone to the another (probably server) time zone to assist in creating a simple trigger with the right date & time.

  Parameters:
    `date` - the date to translate
    `src` - the original time-zone
    `dest` - the destination time-zone
  Returns:
    the translated date

### getOffset

    public static int getOffset(long date,
                                TimeZone tz)

  Deprecated. use TimeZone.getOffset(date)

  Gets the offset from UT for the given date in the given time zone, taking into account daylight savings.

  Equivalent of TimeZone.getOffset(date) in JDK 1.4, but Quartz is trying to support JDK 1.3.

  Parameters:
    `date` - the date (in milliseconds) that is the base for the offset
    `tz` - the time-zone to calculate to offset to
  Returns:
    the offset

### getDSTSavings

    public static int getDSTSavings(TimeZone tz)

  Deprecated. use TimeZone.getDSTSavings()

  Equivalent of TimeZone.getDSTSavings() in JDK 1.4, but Quartz is trying to support JDK 1.3.

  Parameters:
    `tz` - the target time-zone
  Returns:
    the amount of saving time in milliseconds

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001-2012, Terracotta, Inc.