com.taggercat.util
Class DateUtils

java.lang.Object
  extended by com.taggercat.util.DateUtils

public class DateUtils
extends java.lang.Object

 

Constructor Summary
DateUtils()
           
 
Method Summary
static java.util.Date endOfDay()
          Returns the date at the end of the current day.
static java.util.Date endOfDay(java.util.Calendar cal)
           
static java.util.Date endOfDay(java.util.Date date)
          Returns the date at the end of the current day.
static java.util.Date endOfDay(java.util.Date date, java.util.Calendar cal)
          Returns the date at the end of the current day.
static java.util.Date endOfHour(java.util.Date date)
          Returns the date at the end of the current hour.
static java.util.Date endOfHour(java.util.Date date, java.util.Calendar cal)
          Returns the date at the end of the current hour.
static java.util.Date endOfMonth()
          Returns the date at the end of the current month.
static java.util.Date endOfMonth(java.util.Date date)
          Returns the date at the end of the month for the specified date
static java.util.Date endOfMonth(java.util.Date date, java.util.Calendar cal)
          Returns the date at the end of the month for the specified date
static java.util.Date[] getKeyWordDateRange(java.lang.String keyword)
          Returns the date range for the specified key word date range
static java.util.Date[] getQuarter(java.util.Calendar calendar, int q)
          Returns the two dates that represent the start and end of a quarter
static java.util.Date[] getQuarter(int q)
          Returns the two dates that represent the start and end of a quarter of the current year.
static java.util.Date[] last90Days()
          Returns the two dates that represent the start and end of the last quarter
static java.util.Date[] lastMonth()
          Returns the two dates that represent the start and end of last month
static java.util.Date[] lastNDays(int n)
          Returns the two dates that represent the start and end of the last N days
static java.util.Date[] lastQuarter()
          Returns the two dates that represent the start and end of the last quarter
static java.util.Date[] lastWeek()
          Returns the two dates that represent the start and end of last week
static java.util.Date[] lastYear()
          Returns the two dates that represent the start and end of last year
static void main(java.lang.String[] args)
           
static java.util.Date[] nextMonth()
          Returns the two dates that represent the start and end of next month
static java.util.Date[] nextNDays(int n)
          Returns the two dates that represent the start and end of the next N days
static java.util.Date[] nextWeek()
          Returns the two dates that represent the start and end of next week
static java.util.Date[] nextYear()
          Returns the two dates that represent the start and end of next year
static java.util.Date noonOfDay(java.util.Date date, java.util.Calendar cal)
           
static java.util.Date startOfDay()
          Returns the start of the day for the current system date
static java.util.Date startOfDay(java.util.Calendar cal)
           
static java.util.Date startOfDay(java.util.Date date)
          Returns the start of the day for the specified date
static java.util.Date startOfDay(java.util.Date date, java.util.Calendar cal)
          Returns the start of the day for the specified date and calendar
static java.util.Date startOfMonth()
          Returns the start of the month for the current system date
static java.util.Date startOfMonth(java.util.Date date)
          Returns the start of the month for the specified date
static java.util.Date startOfMonth(java.util.Date date, java.util.Calendar cal)
          Returns the start of the month for the specified date and calendar
static java.util.Date[] thisMonth()
          Returns the two dates that represent the start and end of this month
static java.util.Date[] thisQuarter()
          Returns the two dates that represent the start and end of this quarter
static java.util.Date[] thisWeek()
          Returns the two dates that represent the start and end of this week
static java.util.Date[] thisYear()
          Returns the two dates that represent the start and end of this year
static java.util.Date[] today()
          Returns the two dates that represent the start and end of today
static java.util.Date[] tomorrow()
          Returns the two dates that represent the start and end of tomorrow
static java.util.Date[] yearToDate()
          Returns the two dates that represent the Year to Date
static java.util.Date[] yesterday()
          Returns the two dates that represent the start and end of yesterday
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtils

public DateUtils()
Method Detail

endOfDay

public static java.util.Date endOfDay()
Returns the date at the end of the current day.

Returns:
the date at the end of the current day

endOfDay

public static java.util.Date endOfDay(java.util.Calendar cal)

endOfDay

public static java.util.Date endOfDay(java.util.Date date)
Returns the date at the end of the current day.

Parameters:
date - the date
Returns:
the date at the end of the current day

endOfDay

public static java.util.Date endOfDay(java.util.Date date,
                                      java.util.Calendar cal)
Returns the date at the end of the current day.

Parameters:
date - the date
cal - the calendar
Returns:
the date at the end of the current day

endOfHour

public static java.util.Date endOfHour(java.util.Date date)
Returns the date at the end of the current hour.

Parameters:
date - the date
Returns:
the date at the end of the current hour

endOfHour

public static java.util.Date endOfHour(java.util.Date date,
                                       java.util.Calendar cal)
Returns the date at the end of the current hour.

Parameters:
date - the date
cal - the calendar
Returns:
the date at the end of the current hour

endOfMonth

public static java.util.Date endOfMonth()
Returns the date at the end of the current month.

Returns:
the date at the end of the current month

endOfMonth

public static java.util.Date endOfMonth(java.util.Date date)
Returns the date at the end of the month for the specified date

Returns:
the date at the end of the month for the specified date

endOfMonth

public static java.util.Date endOfMonth(java.util.Date date,
                                        java.util.Calendar cal)
Returns the date at the end of the month for the specified date

Parameters:
date - the date
cal - the calendar
Returns:
the date at the end of the month for the specified date

lastMonth

public static java.util.Date[] lastMonth()
Returns the two dates that represent the start and end of last month

Returns:
the two dates that represent this period

getQuarter

public static java.util.Date[] getQuarter(int q)
Returns the two dates that represent the start and end of a quarter of the current year.

Returns:
the two dates that represent this period

lastQuarter

public static java.util.Date[] lastQuarter()
Returns the two dates that represent the start and end of the last quarter

Returns:
the two dates that represent this period

getQuarter

public static java.util.Date[] getQuarter(java.util.Calendar calendar,
                                          int q)
Returns the two dates that represent the start and end of a quarter

Returns:
the two dates that represent this period

thisQuarter

public static java.util.Date[] thisQuarter()
Returns the two dates that represent the start and end of this quarter

Returns:
the two dates that represent this period

last90Days

public static java.util.Date[] last90Days()
Returns the two dates that represent the start and end of the last quarter

Returns:
the two dates that represent this period

nextNDays

public static java.util.Date[] nextNDays(int n)
Returns the two dates that represent the start and end of the next N days

Returns:
the two dates that represent this period

lastNDays

public static java.util.Date[] lastNDays(int n)
Returns the two dates that represent the start and end of the last N days

Returns:
the two dates that represent this period

lastWeek

public static java.util.Date[] lastWeek()
Returns the two dates that represent the start and end of last week

Returns:
the two dates that represent this period

lastYear

public static java.util.Date[] lastYear()
Returns the two dates that represent the start and end of last year

Returns:
the two dates that represent this period

yearToDate

public static java.util.Date[] yearToDate()
Returns the two dates that represent the Year to Date

Returns:
the two dates that represent this period

main

public static void main(java.lang.String[] args)
Parameters:
args -

nextMonth

public static java.util.Date[] nextMonth()
Returns the two dates that represent the start and end of next month

Returns:
the two dates that represent this period

nextWeek

public static java.util.Date[] nextWeek()
Returns the two dates that represent the start and end of next week

Returns:
the two dates that represent this period

nextYear

public static java.util.Date[] nextYear()
Returns the two dates that represent the start and end of next year

Returns:
the two dates that represent this period

noonOfDay

public static java.util.Date noonOfDay(java.util.Date date,
                                       java.util.Calendar cal)

startOfDay

public static java.util.Date startOfDay()
Returns the start of the day for the current system date

Returns:
the start of the day for the current system date

startOfDay

public static java.util.Date startOfDay(java.util.Calendar cal)

startOfDay

public static java.util.Date startOfDay(java.util.Date date)
Returns the start of the day for the specified date

Parameters:
date - the date
Returns:
the start of the day for the specified date

startOfDay

public static java.util.Date startOfDay(java.util.Date date,
                                        java.util.Calendar cal)
Returns the start of the day for the specified date and calendar

Parameters:
date - the date
cal - the calendar
Returns:
the start of the day for the specified date and calendar

startOfMonth

public static java.util.Date startOfMonth()
Returns the start of the month for the current system date

Returns:
Start of the month for the current system date

startOfMonth

public static java.util.Date startOfMonth(java.util.Date date)
Returns the start of the month for the specified date

Parameters:
date - the date
Returns:
Start of the month for the specified date

startOfMonth

public static java.util.Date startOfMonth(java.util.Date date,
                                          java.util.Calendar cal)
Returns the start of the month for the specified date and calendar

Parameters:
date - the date
cal - the calendar
Returns:
the start of the month for the specified date and calendar

getKeyWordDateRange

public static java.util.Date[] getKeyWordDateRange(java.lang.String keyword)
Returns the date range for the specified key word date range


thisMonth

public static java.util.Date[] thisMonth()
Returns the two dates that represent the start and end of this month

Returns:
the two dates that represent this period

thisWeek

public static java.util.Date[] thisWeek()
Returns the two dates that represent the start and end of this week

Returns:
the two dates that represent this period

thisYear

public static java.util.Date[] thisYear()
Returns the two dates that represent the start and end of this year

Returns:
the two dates that represent this period

today

public static java.util.Date[] today()
Returns the two dates that represent the start and end of today

Returns:
the two dates that represent this period

tomorrow

public static java.util.Date[] tomorrow()
Returns the two dates that represent the start and end of tomorrow

Returns:
the two dates that represent this period

yesterday

public static java.util.Date[] yesterday()
Returns the two dates that represent the start and end of yesterday

Returns:
the two dates that represent this period