Date/Time Arithmetic Routines Category

Various routines for Manipulating Dates and Times.

Routines
AddCalendarMonthsAdds a Specified Number of Calendar Months to a Given Date/Time.
AddDaysAdds a Floating Point amount of Days to a Given Date/Time.
AddFortnightsAdds a Floating Point amount of Fortnights to a Given Date/Time.
AddHrsAdds a Floating Point amount of Hours to a Given Date/Time.
AddMinsAdds a Floating Point amount of Minutes to a Given Date/Time.
AddMonthsAdds a Floating Point amount of Months to a Given Date/Time.
AddQuartersAdds a Floating Point amount of Quarters to a Given Date/Time.
AddSecsAdds a Floating Point amount of Seconds to a Given Date/Time.
AddSemestersAdds a Floating Point amount of Semesters to a Given Date/Time.
AddWeeksAdds a Floating Point amount of Weeks to a Given Date/Time.
AddYrsAdds a Floating Point amount of Years to a Given Date/Time.
AdjustDateYearAdjusts the date so that it has the Year specified.
AgeAtDateReturns the Age (in years) of a "person" given their Date of Birth (DOB) and the Date of Reference (DT).
AgeAtDateInMonthsReturns the Age (in months) of a "person" given their Date of Birth (DOB) and the Date of Reference (DT).
AgeAtDateInWeeksReturns the Age (in weeks) of a "person" given their Date of Birth (DOB) and the Date of Reference (DT).
AgeNowReturns the current Age (in years) of a "person" given their Date of Birth (DOB) using the System Date.
AgeNowInMonthsReturns the current Age (in months) of a "person" given their Date of Birth (DOB) using the System Date.
AgeNowInWeeksReturns the current Age (in weeks) of a "person" given their Date of Birth (DOB) using the System Date.
CalendarMonthsApartReturns the Number of Calendar Months between DT2 and DT1.
CalendarWeeksApartReturns the Number of Calendar Weeks between DT2 and DT1.
Date2ISOWeekNoConverts Dates into a Week No and Year according to ISO-8601.
Date2WeekNoConverts Dates into a Week No in the Current Year.
DatesInSameMonthReturns true if both DateTimes refer to the same Calendar Month, can have different years.
DatesInSameMonthYearReturns true if both DateTimes refer to the exact same Month, cannot have different years.
DatesInSameWeekNoReturns true if the two Dates are in the same WeekNo.
DatesInSameYearReturns true if both DateTimes refer to the same Year.
DayOfMonth2DateReturns the Given Occurrence (Day of Month) of a Day of Week in a given Month/Year.
DayOfYearReturns the Day Number in the Year represented by the given Date.
DaysApartReturns the Number of Days between DT2 and DT1.
DaysInMonthReturns the number of days in the Month represented by the given Date.
DaysInThisMonthReturns the number of days in the current Month.
DaysInYearReturns the number of days in the Year represented by the given Date.
DaysLeftInMonthReturns the Number of days left in the Month represented by the given Date.
DaysLeftInThisMonthReturns the number of days left in the current Month.
DaysLeftInThisYearReturns the number of days left in this Year.
DaysLeftInYearReturns the number of days left in the Year represented by the given Date.
DOW2ISODOWConverts a Delphi Day of Week into an ISO-8601 Day Of Week.
DOWsInMonthReturns the number of the specified Day of Week in the Given Month/Year.
DOWsInRangeReturns the number of the specified Day of Week in the Given Date Range (inclusive).
DWY2DateReturns the Date for a given Day of Week, a given WeekNo, and the given Year, assuming that the Start of the Week is Sunday, and that DOW uses 1 for Sunday.
EndOfISOWeekReturns the End of the week containing given Date/Time, assumes that the End of the Week is Sunday according to ISO-8601 - Time portion preserved.
EndOfISOWeekNoReturns the End of the Week for the given ISO-8601 WeekNo in the given year.
EndOfWeekReturns the End of the week containing given Date/Time, assumes that the End of the Week is Saturday - Time portion preserved.
EndOfWeekNoReturns the End of the Week for the given WeekNo in the given year, assuming that the End of the Week is Saturday.
ESBTodayA Speed Optimised Routine to get the Current Date.
ESBTomorrowA Speed Optimised Routine to get the Tomorrow's Date.
ESBYesterdayA Speed Optimised Routine to get the Yesterday's Date.
ExactWeeksApartReturns the Exact Number of Weeks between DT2 and DT1.
GetChristmasDayReturns Christmas Day, for a given Year.
GetDateTimeStampReturns the current date/time as a string in the Format of: YYYYMMDD-HHMMSSmmm.
GetEasterSundayReturns the Date of Easter Sunday for given Year - based on current Calendar.
GetEpactReturn the Epact, which is a measure of the age of the moon (ie the number of days that have passed since an "official" new moon) on a particular date.
GetFirstDayOfMonthReturns First Day of the Month, for a given Date/Time - Time portion preserved.
GetFirstDayOfQuarterReturns First Day of the Quarter, for a given Date/Time - Time portion, preserved or Returns First Day of the Quarter, for a given Quarter and Year.
GetFirstDayOfYearReturns First Day of the Year, for a given Year.
GetFirstMondayOfYearReturns First Monday of the Year, for a given Year.
GetFirstSundayOfYearReturns First Sunday of the Year, for a given Year.
GetGoldenNumberReturns the GoldenNumber for a given Year.
GetGoodFridayReturns the Date of Good Friday for given Year - based on current Calendar.
GetLastDayOfMonthReturns Last Day of the Month, for a given Date/Time - Time portion preserved.
GetLastDayOfQuarterReturns Last Day of the Quarter, for a given Date/Time - Time portion preserved or Returns Last Day of the Quarter, for a given Quarter and Year.
GetLastDayOfYearReturns Last Day of the Year, for a given Year.
IsLeapYearIs given Year a Leap Year.
ISODayOfWeekReturns Day Of Week According to ISO-8601 which has Monday as 1 and Sunday as 7.
ISODOW2DOWConverts an ISO-8601 Day of Week into a Delphi Day Of Week.
ISOWeeksApartReturns the Number of ISO Weeks between DT2 and DT1.
ISOWeeksInYearMost years have 52 weeks, but years that start on a Thursday and leap years that start on a Wednesday (or Thursday) have 53 weeks.
ISOYWD2DateReturns the Date for a given Day of Week, a given WeekNo, and the given Year, as defined in ISO-8601.
IsWorkingDayReturns True if the specified Date is a Working Day.
MinutesApartReturns the number of whole minutes apart the two times are (date portion ignored) and DT1 is assumed to be before DT2.
MS2TimeStrConverts a time in MilliSeconds to a string of the form 'H:MM:SS.mmm'.
OptDateA Speed Optimised Routine to get the Current Date.
OptDayOfYearReturns the Day Number in the Year represented by the given Date.
OptDaysLeftInThisYearReturns the number of days left in this Year.
OptDaysLeftInYearReturns the number of days left in the Year represented by the given Date.
OptThisDayOfYearReturns the Day Number in this Year represented by today.
StartOfISOWeekReturns the Start of the week containing given Date/Time, assumes that the Start of the Week is Monday according to ISO-8601 - Time portion preserved.
StartOfISOWeekNoReturns the Start of the Week for the given ISO-8601 WeekNo in the given year.
StartOfWeekReturns the Start of the week containing given Date/Time, assumes that the Start of the Week is Sunday - Time portion preserved.
StartOfWeekNoReturns the Start of the Week for the given WeekNo in the given year, assuming that the Start of the Week is Sunday.
SubtractDaysSubtracts a Floating Point amount of Days from a Given Date/Time.
SubtractFortnightsSubtracts a Floating Point amount of Fortnights from a Given Date/Time.
SubtractHrsSubtracts a Floating Point amount of Hours from a Given Date/Time.
SubtractMinsSubtracts a Floating Point amount of Minutes from a Given Date/Time.
SubtractMonthsSubtracts a Floating Point amount of Months from a Given Date/Time.
SubtractQuartersSubtracts a Floating Point amount of Quarters from a Given Date/Time.
SubtractSecsSubtracts a Floating Point amount of Seconds from a Given Date/Time.
SubtractSemestersSubtracts a Floating Point amount of Semesters from a Given Date/Time.
SubtractWeeksSubtracts a Floating Point amount of Weeks from a Given Date/Time.
SubtractYrsSubtracts a Floating Point amount of Years from a Given Date/Time.
ThisDayOfYearReturns the Day Number in this Year represented by today.
ThisISOWeekNoReturns the ISO-8601 WeekNo of the current Date (System Date).
ThisWeekNoReturns the WeekNo of the current Date (System Date).
TimeApartInDaysReturns the decimal number of Days apart the two date/times are.
TimeApartInFortnightsReturns the decimal number of fortnights apart the two date/times are.
TimeApartInHrsReturns the decimal number of hours apart the two date/times are.
TimeApartInMinsReturns the decimal number of Minutes apart the two date/times are.
TimeApartInSecsReturns the decimal number of Seconds apart the two date/times are.
TimeApartInWeeksReturns the decimal number of Weeks apart the two date/times are.
WeekDaysInMonthReturns the number of the Week Days (Mon through Fri) in the Given Month/Year.
WeekendDaysInMonthReturns the number of the WeekEnd Days (Sat & Sun) in the Given Month/Year.
WeekNosApartReturns true No of Weeks, based on WeekNo, that the two dates are apart.
WeeksApartReturns the Number of Weeks between DT2 and DT1.
WhichQuarterReturns 1 if Date in Jan through Mar, 2 if Date in Apr through Jun, 3 if Date in Jul through Sep, 4 if Date in Oct through Dec.
WhichSemesterReturns 1 if Date in Jan through Jun or 2 if Date in Jul through Dec.
iffPerforms an if that can be used in Expressions.
SwapXYSwap 2 Values using a Temp Value.


HTML generated by Time2HELP
http://www.time2help.com