The class DateUtil provides utility methods for manipulating and parsing Date objects
Method DetailDate addDays(Date date, int days) Returns a new Date offset in days from the given date.
Parameters:
Returns: Date Since: 06-27-2007 Date addHours(Date date, int hours) Returns a new Date offset in hours from the given date.
Parameters:
Returns: Date Since: 06-27-2007 Date addMinutes(Date date, int minutes) Returns a new Date offset in minutes from the given date.
Parameters:
Returns: Date Since: 05-29-2009 Date addMonths(Date date, int months) Returns a new Date offset in months from the given date.
Parameters:
Returns: Date Since: 06-27-2007 Date addSeconds(Date date, int seconds) Returns a new Date offset in seconds from the given date.
Parameters:
Returns: Date Since: 12-21-2012 Date addYears(Date date, int years) Returns a new Date offset in years from the given date.
Parameters:
Returns: Date Since: 06-27-2007 Date calcDate(int year, int monthOfYear, int weekOfMonth, int dayOfWeek) Returns the date of the [week] [day] of the given month and year. For example, (2019,3,2,1) will return the 2nd Sunday of March 2019. This may return null if no date exists with the criteria.
Parameters:
Returns: Date Since: 03-08-2019 Date createDate() Creates a date with the current time on the server Returns: Date Since: 06-27-2007 int getAge(Date date) Returns the age in (in years) from the given date. If the date is in the future, this will return a negative number.
Parameters:
Returns: int Since: 06-27-2007 int getAgeInDays(Date startDate, Date endDate) Returns the number of full days between the specified dates. If startDate is after endDate, return this as a negative number.
Parameters:
Returns: int Since: 09-04-2008 int getAgeInHours(Date startDate, Date endDate) Returns the number of full hours between the specified dates. If startDate is after endDate, return this as a negative number.
Parameters:
Returns: int Since: 09-30-2013 long getAgeInMinutes(Date startDate, Date endDate) Returns the number of full minutes between the specified dates. If startDate is after endDate, return this as a negative number.
Parameters:
Returns: long Since: 09-30-2013 int getAgeInMonths(Date startDate, Date endDate) Returns the number of full months between the specified dates. If startDate is after endDate, return this as a negative number.
Parameters:
Returns: int Since: 09-04-2008 long getAgeInSeconds(Date startDate, Date endDate) Returns the number of full seconds between the specified dates. If startDate is after endDate, return this as a negative number.
Parameters:
Returns: long Since: 09-30-2013 int getAgeInYears(Date startDate, Date endDate) Returns the number of full years between the specified dates. If startDate is after endDate, return this as a negative number.
Parameters:
Returns: int Since: 09-04-2008 PacketDataList getCalendar(int year) Returns a calendar datalist for the given year.
Parameters:
Returns: PacketDataList DataList Name: calendar DataList Fields: month, moy, year, week, sun, mon, tue, wed, thu, fri, sat Since: 01-10-2023 Data getDateDiff(Date startDate, Date endDate) Returns a Data object containing fields: years, months, days, hours, minutes, seconds with values representing the time between the two dates. All values are positive.
Parameters:
Returns: Data Since: 09-30-2013 Date getDateNextMonth(int dayOfMonth) Returns a new Date with the given day of the month next month from now.
Parameters:
Returns: Date Since: 06-27-2007 Date getDateThisMonth(int dayOfMonth) Returns a new Date with the given day of this month.
Parameters:
Returns: Date Since: 06-27-2007 int getDay(Date date) Returns the day of the month (1-31) of the given date.
Parameters:
Returns: int Since: 06-27-2007 int getDayOrdinal(Date date) Returns the Nth day of this date. If it is the 1st Thursday, this will return 1. If it is the 3rd Friday, this will return 3.
Parameters:
Returns: int Since: 12-02-2021 Date getEndOfDay(Date date) Returns a new Date which is the beginning of the given day (the time will be 11:59:59 PM).
Parameters:
Returns: Date Since: 03-19-2009 Date getEndOfMonth(Date date) Returns a new Date for the last day of the month of the given date.
Parameters:
Returns: Date Since: 06-27-2007 Date getEndOfYear(Date date) Returns a new Date for the last day of the year of the given date.
Parameters:
Returns: Date Since: 06-27-2007 int getMonth(Date date) Returns the month of the year (1-12) of the given date.
Parameters:
Returns: int Since: 06-27-2007 Date getStartOfDay(Date date) Returns a new Date which is the beginning of the given day (the time will be 12:00:00 AM).
Parameters:
Returns: Date Since: 03-19-2009 Date getStartOfMonth(Date date) Returns a new Date for the first day of the month of the given date.
Parameters:
Returns: Date Since: 06-27-2007 Date getStartOfYear(Date date) Returns a new Date for the first day of the year of the given date.
Parameters:
Returns: Date Since: 06-27-2007 int getWeekOfMonth(Date date) Returns the week of the month for the given date.
Parameters:
Returns: int Since: 12-02-2021 int getWeekOfYear(Date date) Returns the week of the year for the given date.
Parameters:
Returns: int Since: 12-02-2021 int getYear(Date date) Returns the year of the given date.
Parameters:
Returns: int Since: 06-27-2007 boolean isDate(Date date1, Date date2) Returns true if the two dates have the same day, month, and year
Parameters:
Returns: boolean Since: 08-05-2019 boolean isTime(Date date, int startHour, int startMinute, int endHour, int endMinute) Returns true if the date is within the 24 hour start and end times.
Parameters:
Returns: boolean Since: 09-30-2013 Date nextMonth(Date date) Adds a month to the date and returns the date with the same day of week and week of month. Returns null if the operation is not possible.
Parameters:
Returns: Date Since: 12-02-2021 Date parseComplexDate(String date) Creates a date from the given string. Format can be almost any valid date (e.g. Mar. 3rd, 1956 or 5/5/2008). Returns null if the date cannot be parsed.
Parameters:
Returns: Date Since: 07-10-2008 Date parseDate(String date) Creates a date from the given string. Format should be MM-dd-yyyy or MM/dd/yyyy
Parameters:
Returns: Date Since: 06-27-2007 Date parseDate(String date, String pattern) Creates a date from the given string. Format should adhere to pattern. See java.text.SimpleDateFormat API documentation for more information about possible patterns.
Parameters:
Returns: Date Since: 09-14-2009 Date parseDatetime(String date) Creates a date from the given string. String can be either integer value in milliseconds or in format MM-dd-yyyy or MM/dd/yyyy
Parameters:
Returns: Date Since: 02-09-2012 |
Copyright © 2006 - 2024, ContractPal, Inc. All rights reserved. | API Date: Nov 18, 2024 01:04 PM |