net.sourceforge.jtimepiece
Class JTimepiece

java.lang.Object
  extended by net.sourceforge.jtimepiece.JTimepiece

public class JTimepiece
extends java.lang.Object

This class contains many useful methods for working with calendars, dates and times.

Author:
Robert Breidecker

Constructor Summary
JTimepiece()
          Default constructor.
JTimepiece(java.util.Calendar calendar)
          This constructor takes as calendar as input.
JTimepiece(java.util.Locale locale)
          This constructor takes a locale as input and can be used for processing involving other locations other than the default.
JTimepiece(java.util.TimeZone timeZone)
          This constructor of the constructor takes a time zone as input.
JTimepiece(java.util.TimeZone timeZone, java.util.Locale locale)
          This constructor takes a time zone as input and can be used for advanced processing involving such things as daylight savings time.
 
Method Summary
 java.util.Date addDay(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of days from a given date.
 java.util.Date addHour(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of hours from a given date.
 java.util.Date addMillisecond(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of milliseconds from a given date.
 java.util.Date addMinute(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of minutes from a given date.
 java.util.Date addMonth(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of months from a given date.
 java.util.Date addSecond(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of seconds from a given date.
 java.util.Date addYear(java.util.Date inputDate, int amount)
          Returns a new date that is a specified number of years from a given date.
 java.lang.String convertDateToString(java.util.Date inputDate, java.lang.String dateFormat)
          Converts a date to a string of a specified format.
 java.util.Date convertStringToDate(java.lang.String inputDate, java.lang.String dateFormat)
          Converts a string to a date.
 java.util.Date createDate(int inputYear, int inputMonth, int inputDay)
          Creates a new date from a year, month and day.
 java.util.Date createDate(int inputYear, int inputMonth, int inputDay, int inputHour, int inputMinute, int inputSecond)
          Creates a new date from a year, month, day, hour, minute and second.
 java.util.Date createDate(int inputYear, int inputMonth, int inputDay, int inputHour, int inputMinute, int inputSecond, int inputMillisecond)
          Creates a new date from a year, month, day, hour, minute, second and millisecond.
 int getCalendarDaysAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of calendar days date2 is after date1.
 int getCalendarMonthsAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of calendar months date2 is after date1.
 int getCalendarYearsAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of calendar years date2 is after date1.
 java.util.Date getCurrentDate()
          Returns the current date and time.
 java.lang.String getDayAbrv(java.util.Date inputDate)
          Returns the abbreviation of the day from the input date.
 java.lang.String getDayName(java.util.Date inputDate)
          Returns the day name from the input date, such as "Monday" or "Tuesday".
 int getDayOfMonth(java.util.Date inputDate)
          Returns the day of month from the input date.
 int getDayOfWeek(java.util.Date inputDate)
          Returns the day of week from the input date.
 int getDayOfYear(java.util.Date inputDate)
          Returns the day of year from the input date.
 double getDaysAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of days date2 is after date1.
 int getFirstDayOfWeek(java.util.Date inputDate)
          Returns the first day of the week.
 int getHour(java.util.Date inputDate)
          Returns the hour from the input date.
 int getHourOfDay(java.util.Date inputDate)
          Returns the hour of day from the input date.
 double getHoursAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of hours date2 is after date1.
 java.util.Date getLastDateOfMonth(java.util.Date inputDate)
          This method will return a date which represents the last date of the month in the input date.
 int getMillisecond(java.util.Date inputDate)
          Returns the millisecond from the input date.
 long getMillisecondsAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of milliseconds date2 is after date1.
 int getMinute(java.util.Date inputDate)
          Returns the minute from the input date.
 double getMinutesAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of minutes date2 is after date1.
 int getMonth(java.util.Date inputDate)
          Returns the month from the input date.
 java.lang.String getMonthAbrv(java.util.Date inputDate)
          Returns the month abbreviation from the input date.
 java.lang.String getMonthName(java.util.Date inputDate)
          Returns the month name from the input date, such as "January" or "February".
 int getSecond(java.util.Date inputDate)
          Returns the second from the input date.
 double getSecondsAfter(java.util.Date date1, java.util.Date date2)
          Returns the number of seconds date2 is after date1.
 int getTimeZoneOffset(java.util.Date inputDate)
          Returns the time zone offset from the input date.
 int getWeekOfMonth(java.util.Date inputDate)
          Returns the week of month from the input date.
 int getWeekOfYear(java.util.Date inputDate)
          Returns the week of year from the input date.
 int getYear(java.util.Date inputDate)
          Returns the year from the input date.
 boolean isAfter(java.util.Date date1, java.util.Date date2)
          Indicates if date1 is after date2.
 boolean isAM(java.util.Date inputDate)
          Indicates if the time in the input date is in the AM or not.
 boolean isBefore(java.util.Date date1, java.util.Date date2)
          Indicates if date1 is before date2.
 boolean isEqualTo(java.util.Date date1, java.util.Date date2)
          Indicates if date1 is equal to date2.
 boolean isLeapYear(java.util.Date inputDate)
          Indicates if the year is a leap year or not.
 boolean isPM(java.util.Date inputDate)
          Indicates if the time in the input date is in the PM or not.
 java.util.Date setDayOfMonth(java.util.Date inputDate, int dayOfMonth)
          Sets the day of month on the input date.
 java.util.Date setDayOfWeek(java.util.Date inputDate, int dayOfWeek)
          Sets the day of week on the input date.
 java.util.Date setDayOfYear(java.util.Date inputDate, int dayOfYear)
          Sets the day of year on the input date.
 java.util.Date setHour(java.util.Date inputDate, int hour)
          Sets the hour on the input date.
 java.util.Date setHourOfDay(java.util.Date inputDate, int hourOfDay)
          Sets the hour of day on the input date.
 java.util.Date setMillisecond(java.util.Date inputDate, int millisecond)
          Sets the millisecond on the input date.
 java.util.Date setMinute(java.util.Date inputDate, int minute)
          Sets the minute on the input date.
 java.util.Date setMonth(java.util.Date inputDate, int month)
          Sets the month on the input date.
 java.util.Date setSecond(java.util.Date inputDate, int second)
          Sets the second on the input date.
 java.util.Date setWeekOfMonth(java.util.Date inputDate, int weekOfMonth)
          Sets the week of month on the input date.
 java.util.Date setWeekOfYear(java.util.Date inputDate, int weekOfYear)
          Sets the week of year on the input date.
 java.util.Date setYear(java.util.Date inputDate, int year)
          Sets the year on the input date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTimepiece

public JTimepiece()
Default constructor. This constructor does not use any parameters. A GregorianCalendar is used as the internal calendar and the default time zone and locale are used.


JTimepiece

public JTimepiece(java.util.Calendar calendar)
This constructor takes as calendar as input. This constructor can be used when you do not want a GregorianCalendar to created by default.

Parameters:
calendar - The calendar to be used internally by many of the methods in this class.

JTimepiece

public JTimepiece(java.util.Locale locale)
This constructor takes a locale as input and can be used for processing involving other locations other than the default. A GregorianCalendar is used as the internal calendar and is created using the input locale.

Parameters:
locale - The input time zone.

JTimepiece

public JTimepiece(java.util.TimeZone timeZone)
This constructor of the constructor takes a time zone as input. A GregorianCalendar is used as the internal calendar and is created using the input time zone.

Parameters:
timeZone - The input time zone.

JTimepiece

public JTimepiece(java.util.TimeZone timeZone,
                  java.util.Locale locale)
This constructor takes a time zone as input and can be used for advanced processing involving such things as daylight savings time. This constructor also takes a locale as input and can be used for processing involving other locations other than the default. A GregorianCalendar is used as the internal calendar and is created using the input tiem zone and locale.

Parameters:
timeZone - The input time zone.
locale - The input time zone.
Method Detail

addDay

public java.util.Date addDay(java.util.Date inputDate,
                             int amount)
Returns a new date that is a specified number of days from a given date.

Parameters:
inputDate - The original date to add days to.
amount - A positive, zero or negative number of days to add to the original date.
Returns:
A new date that is a specified number of days from a given date.

addHour

public java.util.Date addHour(java.util.Date inputDate,
                              int amount)
Returns a new date that is a specified number of hours from a given date.

Parameters:
inputDate - The original date to add hours to.
amount - A positive, zero or negative number of hours to add to the original date.
Returns:
A new date that is a specified number of hours from a given date.

addMillisecond

public java.util.Date addMillisecond(java.util.Date inputDate,
                                     int amount)
Returns a new date that is a specified number of milliseconds from a given date.

Parameters:
inputDate - The original date to add milliseconds to.
amount - A positive, zero or negative number of milliseconds to add to the original date.
Returns:
A new date that is a specified number of milliseconds from a given date.

addMinute

public java.util.Date addMinute(java.util.Date inputDate,
                                int amount)
Returns a new date that is a specified number of minutes from a given date.

Parameters:
inputDate - The original date to add minutes to.
amount - A positive, zero or negative number of minutes to add to the original date.
Returns:
A new date that is a specified number of minutes from a given date.

addMonth

public java.util.Date addMonth(java.util.Date inputDate,
                               int amount)
Returns a new date that is a specified number of months from a given date.

Parameters:
inputDate - The original date to add months to.
amount - A positive, zero or negative number of months to add to the original date.
Returns:
A new date that is a specified number of months from a given date.

addSecond

public java.util.Date addSecond(java.util.Date inputDate,
                                int amount)
Returns a new date that is a specified number of seconds from a given date.

Parameters:
inputDate - The original date to add seconds to.
amount - A positive, zero or negative number of seconds to add to the original date.
Returns:
A new date that is a specified number of seconds from a given date.

addYear

public java.util.Date addYear(java.util.Date inputDate,
                              int amount)
Returns a new date that is a specified number of years from a given date.

Parameters:
inputDate - The original date to add years to.
amount - A positive, zero or negative number of years to add to the original date.
Returns:
A new date that is a specified number of years from a given date.

convertDateToString

public java.lang.String convertDateToString(java.util.Date inputDate,
                                            java.lang.String dateFormat)
Converts a date to a string of a specified format.

Parameters:
inputDate - The original date to convert to a string.
dateFormat - The format to convert the date to. See the official Javadoc for the Java class SimpleDateFormat for a description of format syntax.
Returns:
A string representing the original date in the specified format.

convertStringToDate

public java.util.Date convertStringToDate(java.lang.String inputDate,
                                          java.lang.String dateFormat)
Converts a string to a date.

Parameters:
inputDate - The orignal date in string format.
dateFormat - The current format of the string date. See the official Javadoc for the Java class SimpleDateFormat for a description of format syntax.
Returns:
A date created from the input string.
Throws:
java.lang.IllegalArgumentException - Input data is invalid.

createDate

public java.util.Date createDate(int inputYear,
                                 int inputMonth,
                                 int inputDay)
Creates a new date from a year, month and day.

Parameters:
inputYear - The input year.
inputMonth - The input month.
inputDay - The input day.
Returns:
The new date created from the input year, month and day.

createDate

public java.util.Date createDate(int inputYear,
                                 int inputMonth,
                                 int inputDay,
                                 int inputHour,
                                 int inputMinute,
                                 int inputSecond)
Creates a new date from a year, month, day, hour, minute and second.

Parameters:
inputYear - The input year.
inputMonth - The input month.
inputDay - The input day.
inputHour - The input hour of the day. This should be from 0 to 23.
inputMinute - The input minute.
inputSecond - The input second.
Returns:
The new date created from the input year, month, day, hour, minute and second.

createDate

public java.util.Date createDate(int inputYear,
                                 int inputMonth,
                                 int inputDay,
                                 int inputHour,
                                 int inputMinute,
                                 int inputSecond,
                                 int inputMillisecond)
Creates a new date from a year, month, day, hour, minute, second and millisecond.

Parameters:
inputYear - The input year.
inputMonth - The input month.
inputDay - The input day.
inputHour - The input hour of the day. This should be from 0 to 23.
inputMinute - The input minute.
inputSecond - The input second.
Returns:
The new date created from the input year, month, day, hour, minute, second and millisecond.

getCalendarDaysAfter

public int getCalendarDaysAfter(java.util.Date date1,
                                java.util.Date date2)
Returns the number of calendar days date2 is after date1. If date2 is before date1, then a negative number is returned. This method does not take into account time. Therefore, the difference between 2001-04-31 11:23:54 PM and 2001-05-01 00:01:12 AM is one day.

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of days date2 is after date1.

getCalendarMonthsAfter

public int getCalendarMonthsAfter(java.util.Date date1,
                                  java.util.Date date2)
Returns the number of calendar months date2 is after date1. If date2 is before date1, then a negative number is returned. This method does not take into account time or days. Therefore, the difference between 2001-04-31 11:23:54 PM and 2001-05-01 00:01:12 AM is one month.

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of months date2 is after date1.

getCalendarYearsAfter

public int getCalendarYearsAfter(java.util.Date date1,
                                 java.util.Date date2)
Returns the number of calendar years date2 is after date1. If date2 is before date1, then a negative number is returned. This method does not take into account time, days or months. Therefore, the difference between 2000-12-31 11:23:54 PM and 2001-01-01 00:01:12 AM is one year.

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of years date2 is after date1.

getCurrentDate

public java.util.Date getCurrentDate()
Returns the current date and time.

Returns:
A date representing the current date and time.

getDayAbrv

public java.lang.String getDayAbrv(java.util.Date inputDate)
Returns the abbreviation of the day from the input date. Abbreviations are three letters in length. For example the abbreviation for Monday is "Mon" and Tuesday is "Tue".

Parameters:
inputDate - The date for which the day abbreviation is requested.
Returns:
The day abbreviation for the input date.

getDayName

public java.lang.String getDayName(java.util.Date inputDate)
Returns the day name from the input date, such as "Monday" or "Tuesday".

Parameters:
inputDate - The date for which the day name is requested.
Returns:
The day name for the input date.

getDayOfMonth

public int getDayOfMonth(java.util.Date inputDate)
Returns the day of month from the input date.

Parameters:
inputDate - The date for which the day of month is requested.
Returns:
The day of month for the input date.

getDayOfWeek

public int getDayOfWeek(java.util.Date inputDate)
Returns the day of week from the input date. The days of the week begin with 1 which represents Sunday. Monday is represented by 2, Tuesday is represented by 3 and so on.

Parameters:
inputDate - The date for which the day of week is requested.
Returns:
The day of week for the input date.

getDayOfYear

public int getDayOfYear(java.util.Date inputDate)
Returns the day of year from the input date.

Parameters:
inputDate - The date for which the day of year is requested.
Returns:
The day of year for the input date.

getDaysAfter

public double getDaysAfter(java.util.Date date1,
                           java.util.Date date2)
Returns the number of days date2 is after date1. If date2 is before date1, then a negative number is returned. The number returned is based on the number of milliseconds each date is from the epoch (January 1, 1970, 00:00:00 GMT).

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of days date2 is after date1.

getFirstDayOfWeek

public int getFirstDayOfWeek(java.util.Date inputDate)
Returns the first day of the week. In the US, the first day of the week is Sunday and in France it is Monday.

Parameters:
inputDate - The date for which the first day of the week is requested.
Returns:
The first day of the week.

getHour

public int getHour(java.util.Date inputDate)
Returns the hour from the input date. This hour represents the hour of the morning or afternoon.

Parameters:
inputDate - The date for which the hour is requested.
Returns:
The hour from the input date.

getHourOfDay

public int getHourOfDay(java.util.Date inputDate)
Returns the hour of day from the input date. This hour is the same as a military time hour.

Parameters:
inputDate - The date for which the hour of day is requested.
Returns:
The hour of day from the input date.

getHoursAfter

public double getHoursAfter(java.util.Date date1,
                            java.util.Date date2)
Returns the number of hours date2 is after date1. If date2 is before date1, then a negative number is returned. The number returned is based on the number of milliseconds each date is from the epoch (January 1, 1970, 00:00:00 GMT).

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of hours date2 is after date1.

getLastDateOfMonth

public java.util.Date getLastDateOfMonth(java.util.Date inputDate)
This method will return a date which represents the last date of the month in the input date.

Parameters:
inputDate - The inputDate the date to obtain the last date of month for.
Returns:
A date which represents the last date of the month

getMillisecond

public int getMillisecond(java.util.Date inputDate)
Returns the millisecond from the input date.

Parameters:
inputDate - The date for which the millisecond is requested.
Returns:
The millisecond from the input date.

getMillisecondsAfter

public long getMillisecondsAfter(java.util.Date date1,
                                 java.util.Date date2)
Returns the number of milliseconds date2 is after date1. If date2 is before date1, then a negative number is returned. The number returned is based on the number of milliseconds each date is from the epoch (January 1, 1970, 00:00:00 GMT).

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of milliseconds date2 is after date1.

getMinute

public int getMinute(java.util.Date inputDate)
Returns the minute from the input date.

Parameters:
inputDate - The date for which the minute is requested.
Returns:
The minute from the input date.

getMinutesAfter

public double getMinutesAfter(java.util.Date date1,
                              java.util.Date date2)
Returns the number of minutes date2 is after date1. If date2 is before date1, then a negative number is returned. The number returned is based on the number of milliseconds each date is from the epoch (January 1, 1970, 00:00:00 GMT).

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of minutes date2 is after date1.

getMonth

public int getMonth(java.util.Date inputDate)
Returns the month from the input date.

Parameters:
inputDate - The date for which the month is requested.
Returns:
The month from the input date.

getMonthAbrv

public java.lang.String getMonthAbrv(java.util.Date inputDate)
Returns the month abbreviation from the input date. Abbreviations are three letters in length. For example the abbreviation for January is "Jan" and February is "Feb".

Parameters:
inputDate - The date for which the month abbreviation is requested.
Returns:
The month abbreviation from the input date.

getMonthName

public java.lang.String getMonthName(java.util.Date inputDate)
Returns the month name from the input date, such as "January" or "February".

Parameters:
inputDate - The date for which the month name is requested.
Returns:
The month name from the input date.

getSecond

public int getSecond(java.util.Date inputDate)
Returns the second from the input date.

Parameters:
inputDate - The date for which the second is requested.
Returns:
The second from the input date.

getSecondsAfter

public double getSecondsAfter(java.util.Date date1,
                              java.util.Date date2)
Returns the number of seconds date2 is after date1. If date2 is before date1, then a negative number is returned. The number returned is based on the number of milliseconds each date is from the epoch (January 1, 1970, 00:00:00 GMT).

Parameters:
date1 - The first date in the range.
date2 - The second date in the range.
Returns:
The number of seconds date2 is after date1.

getTimeZoneOffset

public int getTimeZoneOffset(java.util.Date inputDate)
Returns the time zone offset from the input date. The offset represents the milliseconds from Greenwich Mean Time (GMT).

Parameters:
inputDate - The date for which the time zone offset is requested.
Returns:
The time zone offset from the input date.

getWeekOfMonth

public int getWeekOfMonth(java.util.Date inputDate)
Returns the week of month from the input date.

Parameters:
inputDate - The date for which the week of month is requested.
Returns:
The week of month from the input date.

getWeekOfYear

public int getWeekOfYear(java.util.Date inputDate)
Returns the week of year from the input date.

Parameters:
inputDate - The date for which the week of year is requested.
Returns:
The week of year from the input date.

getYear

public int getYear(java.util.Date inputDate)
Returns the year from the input date.

Parameters:
inputDate - The date for which the year is requested.
Returns:
The year from the input date.

isAfter

public boolean isAfter(java.util.Date date1,
                       java.util.Date date2)
Indicates if date1 is after date2.

Parameters:
date1 - The first date to be compared.
date2 - The second date to be compared.
Returns:
True is date1 is after date2, otherwise false.

isAM

public boolean isAM(java.util.Date inputDate)
Indicates if the time in the input date is in the AM or not.

Parameters:
inputDate - The date to evaluate.
Returns:
True is time of date is in the AM, otherwise false.

isBefore

public boolean isBefore(java.util.Date date1,
                        java.util.Date date2)
Indicates if date1 is before date2.

Parameters:
date1 - The first date to be compared.
date2 - The second date to be compared.
Returns:
True is date1 is before date2, otherwise false.

isEqualTo

public boolean isEqualTo(java.util.Date date1,
                         java.util.Date date2)
Indicates if date1 is equal to date2.

Parameters:
date1 - The first date to be compared.
date2 - The second date to be compared.
Returns:
True is date1 is equal to date2, otherwise false.

isLeapYear

public boolean isLeapYear(java.util.Date inputDate)
Indicates if the year is a leap year or not.

Parameters:
inputDate - The date to evaluate.
Returns:
True is year is a leap year, otherwise false.

isPM

public boolean isPM(java.util.Date inputDate)
Indicates if the time in the input date is in the PM or not.

Parameters:
inputDate - The date to evaluate.
Returns:
True is time of date is in the PM, otherwise false.

setDayOfMonth

public java.util.Date setDayOfMonth(java.util.Date inputDate,
                                    int dayOfMonth)
Sets the day of month on the input date.

Parameters:
inputDate - The date for which to set the day of month.
dayOfMonth - The day of month to set on the input date.
Returns:
The new date with the new day of month value.

setDayOfWeek

public java.util.Date setDayOfWeek(java.util.Date inputDate,
                                   int dayOfWeek)
Sets the day of week on the input date.

Parameters:
inputDate - The date for which to set the day of week.
dayOfWeek - The day of week to set on the input date.
Returns:
The new date with the new day of week value.

setDayOfYear

public java.util.Date setDayOfYear(java.util.Date inputDate,
                                   int dayOfYear)
Sets the day of year on the input date.

Parameters:
inputDate - The date for which to set the day of year.
dayOfYear - The day of year to set on the input date.
Returns:
The new date with the new day of year value.

setHour

public java.util.Date setHour(java.util.Date inputDate,
                              int hour)
Sets the hour on the input date.

Parameters:
inputDate - The date for which to set the hour.
hour - The hour to set on the input date.
Returns:
The new date with the new hour value.

setHourOfDay

public java.util.Date setHourOfDay(java.util.Date inputDate,
                                   int hourOfDay)
Sets the hour of day on the input date.

Parameters:
inputDate - The date for which to set the hour of day.
hourOfDay - The hour to set on the input date.
Returns:
The new date with the new hour of day value.

setMillisecond

public java.util.Date setMillisecond(java.util.Date inputDate,
                                     int millisecond)
Sets the millisecond on the input date.

Parameters:
inputDate - The date for which to set the millisecond.
millisecond - The millisecond to set on the input date.
Returns:
The new date with the new millisecond value.

setMinute

public java.util.Date setMinute(java.util.Date inputDate,
                                int minute)
Sets the minute on the input date.

Parameters:
inputDate - The date for which to set the minute.
minute - The minute to set on the input date.
Returns:
The new date with the new minute value.

setMonth

public java.util.Date setMonth(java.util.Date inputDate,
                               int month)
Sets the month on the input date.

Parameters:
inputDate - The date for which to set the month.
month - The month to set on the input date.
Returns:
The new date with the new month value.

setSecond

public java.util.Date setSecond(java.util.Date inputDate,
                                int second)
Sets the second on the input date.

Parameters:
inputDate - The date for which to set the second.
second - The second to set on the input date.
Returns:
The new date with the new second value.

setWeekOfMonth

public java.util.Date setWeekOfMonth(java.util.Date inputDate,
                                     int weekOfMonth)
Sets the week of month on the input date.

Parameters:
inputDate - The date for which to set the week of month.
weekOfMonth - The week of month to set on the input date.
Returns:
The new date with the new week of month value.

setWeekOfYear

public java.util.Date setWeekOfYear(java.util.Date inputDate,
                                    int weekOfYear)
Sets the week of year on the input date.

Parameters:
inputDate - The date for which to set the week of year.
weekOfYear - The week of year to set on the input date.
Returns:
The new date with the new week of year value.

setYear

public java.util.Date setYear(java.util.Date inputDate,
                              int year)
Sets the year on the input date.

Parameters:
inputDate - The date for which to set the year.
year - The month to set on the input date.
Returns:
The new date with the new year value.


Copyright (C) 2002-2005 Robert Breidecker.