Skip to content

Reference for unit 'DateUtils': Procedures and functionsΒΆ

Procedure/function Description
CompareDate Compare 2 dates, disregarding the time of day.
CompareDateTime Compare 2 dates, taking into account the time of day.
CompareTime Compares two times of the day, disregarding the date part.
DateInRange Checks whether a date value is in a given rang.
DateOf Extract the date part from a TDateTime indication.
DateTimeInRange Checks whether a date/time value is in a given range.
DateTimeToDosDateTime Convert TDateTime format to DOS date/time format.
DateTimeToJulianDate Converts a TDateTime value to a Julian date representation.
DateTimeToMac Convert a TDateTime timestamp to a Mac timestamp.
DateTimeToModifiedJulianDate Convert a TDateTime value to a modified Julian date representation.
DateTimeToUnix Convert a TDateTime value to Unix epoch time.
DateToISO8601 Converts a TDateTime value to ISO 8601 date/time format.
DayOf Extract the day (of month) part from a TDateTime value.
DayOfTheMonth Extract the day (of month) part of a TDateTime value.
DayOfTheWeek Extracts the day of the week from a TDateTime value.
DayOfTheYear Extracts the day of the year from a TDateTime value.
DaysBetween Number of whole days between two TDateTime values.
DaysInAMonth Number of days in a month of a certain year.
DaysInAYear Number of days in a particular year.
DaysInMonth Return the number of days in the month in which a date occurs.
DaysInYear Return the number of days in the year in which a date occurs.
DaySpan Calculate the approximate number of days between two TDateTime values.
DecodeDateDay Decode a TDateTime value in year and year of day.
DecodeDateMonthWeek Decode a TDateTime value in a month, week of month and day of week.
DecodeDateTime Decode a TDateTime value in a date and time value.
DecodeDateWeek Decode a TDateTime value in a week of year and day of week.
DecodeDayOfWeekInMonth Decode a TDateTime value in year, month, day of week parts.
DosDateTimeToDateTime Convert DOS date/time format to TDateTime format.
EncodeDateDay Encodes a year and day of year to a TDateTime value.
EncodeDateMonthWeek Encodes a year, month, week of month and day of week to a TDateTime value.
EncodeDateTime Encodes a TDateTime value from all its parts.
EncodeDateWeek Encode a TDateTime value from a year, week and day of week triplet.
EncodeDayOfWeekInMonth Encodes a year, month, week, day of week specification to a TDateTime value.
EncodeTimeInterval Encode an interval as a TDateTime value.
EndOfADay Calculates a TDateTime value representing the end of a specified day.
EndOfAMonth Calculate a TDateTime value representing the last day of the indicated month.
EndOfAWeek Return the last moment of day of the week, given a year and a week in the year.
EndOfAYear Calculate a TDateTime value representing the last day of a year.
EndOfTheDay Calculate a TDateTime value that represents the end of a given day.
EndOfTheMonth Calculate a TDateTime value representing the last day of the month, given a day in that month.
EndOfTheWeek Calculate a TDateTime value which represents the end of a week, given a date in that week.
EndOfTheYear Calculate a TDateTime value representing the last day of a year, given a date in that year.
HourOf Extract the hour part from a TDateTime value.
HourOfTheDay Calculate the hour of a given TDateTime value.
HourOfTheMonth Calculate the number of hours passed since the start of the month.
HourOfTheWeek Calculate the number of hours elapsed since the start of the week.
HourOfTheYear Calculate the number of hours passed since the start of the year.
HoursBetween Calculate the number of whole hours between two TDateTime values.
HourSpan Calculate the approximate number of hours between two TDateTime values.
IncDay Increase a TDateTime value with a number of days.
IncHour Increase a TDateTime value with a number of hours.
IncMilliSecond Increase a TDateTime value with a number of milliseconds.
IncMinute Increase a TDateTime value with a number of minutes.
IncSecond Increase a TDateTime value with a number of seconds.
IncWeek Increase a TDateTime value with a number of weeks.
IncYear Increase a TDateTime value with a number of years.
InvalidDateDayError Raise an EConvertError exception when a day is not a valid day of a year.
InvalidDateMonthWeekError Raise an EConvertError exception when a Year,Month,WeekOfMonth,DayofWeek is invalid.
InvalidDateTimeError Raise an EConvertError about an invalid date-time specification.
InvalidDateWeekError Raise an EConvertError with an invalid Year, WeekOfyear and DayOfWeek specification.
InvalidDayOfWeekInMonthError Raise an EConvertError exception when a Year,Month,NthDayofWeek,DayofWeek is invalid.
IsAM
IsInLeapYear Determine whether a date is in a leap year.
ISO8601ToDate Converts a date/time value in ISO 8601 notation to a native TDateTime type.
ISO8601ToDateDef Converts an ISO 8601 date/time string to a TDateTime type.
IsPM Determine whether a time is PM or AM.
IsSameDay Check if two date/time indications are the same day.
IsSameMonth Check if 2 dates are in the same month.
IsToday Check whether a given date is today.
IsValidDate Check whether a set of values is a valid date indication.
IsValidDateDay Check whether a given year/day of year combination is a valid date.
IsValidDateMonthWeek Check whether a given year/month/week/day of the week combination is a valid day.
IsValidDateTime Check whether a set of values is a valid date and time indication.
IsValidDateWeek Check whether a given year/week/day of the week combination is a valid day.
IsValidTime Check whether a set of values is a valid time indication.
JulianDateToDateTime Convert a Julian date representation to a TDateTime value.
LocalTimeToUniversal Convert local time to UTC time.
MacTimeStampToUnix Convert a Mac timestamp to a Unix timestamp.
MacToDateTime Convert a Mac timestamp to a TDateTime timestamp.
MilliSecondOf Extract the millisecond part from a TDateTime value.
MilliSecondOfTheDay Calculate the number of milliseconds elapsed since the start of the day.
MilliSecondOfTheHour Calculate the number of milliseconds elapsed since the start of the hour.
MilliSecondOfTheMinute Calculate the number of milliseconds elapsed since the start of the minute.
MilliSecondOfTheMonth Calculate number of milliseconds elapsed since the start of the month.
MilliSecondOfTheSecond Calculate the number of milliseconds elapsed since the start of the second.
MilliSecondOfTheWeek Calculate the number of milliseconds elapsed since the start of the week.
MilliSecondOfTheYear Calculate the number of milliseconds elapsed since the start of the year.
MilliSecondsBetween Calculate the number of whole milliseconds between two TDateTime values.
MilliSecondSpan Calculate the approximate number of milliseconds between two TDateTime values.
MinuteOf Extract the minute part from a TDateTime value.
MinuteOfTheDay Calculate the number of minutes elapsed since the start of the day.
MinuteOfTheHour Calculate the number of minutes elapsed since the start of the hour.
MinuteOfTheMonth Calculate number of minutes elapsed since the start of the month.
MinuteOfTheWeek Calculate the number of minutes elapsed since the start of the week.
MinuteOfTheYear Calculate the number of minutes elapsed since the start of the year.
MinutesBetween Calculate the number of whole minutes between two TDateTime values.
MinuteSpan Calculate the approximate number of minutes between two TDateTime values.
ModifiedJulianDateToDateTime Convert a modified Julian date representation to a TDateTime value.
MonthOf Extract the month from a given date.
MonthOfTheYear Extract the month of a TDateTime indication.
MonthsBetween Calculate the number of whole months between two TDateTime values.
MonthSpan Calculate the approximate number of months between two TDateTime values.
NthDayOfWeek Calculate which occurrence of weekday in the month a given day represents.
PeriodBetween Return the period (in years, months, days) between two dates.
PreviousDayOfWeek Given a day of the week, return the previous day of the week.
RecodeDate Replace date part of a TDateTime value with another date.
RecodeDateTime Replace selected parts of a TDateTime value with other values.
RecodeDay Replace day part of a TDateTime value with another day.
RecodeHour Replace hours part of a TDateTime value with another hour.
RecodeMilliSecond Replace milliseconds part of a TDateTime value with another millisecond.
RecodeMinute Replace minutes part of a TDateTime value with another minute.
RecodeMonth Replace month part of a TDateTime value with another month.
RecodeSecond Replace seconds part of a TDateTime value with another second.
RecodeTime Replace time part of a TDateTime value with another time.
RecodeYear Replace year part of a TDateTime value with another year.
SameDate Check whether two TDateTime values have the same date part.
SameDateTime Check whether two TDateTime values have the same date and time parts.
SameTime Check whether two TDateTime values have the same time part.
ScanDateTime Scans a string for a TDateTime pattern and returns the date/time.
SecondOf Extract the second part from a TDateTime value.
SecondOfTheDay Calculate the number of seconds elapsed since the start of the day.
SecondOfTheHour Calculate the number of seconds elapsed since the start of the hour.
SecondOfTheMinute Calculate the number of seconds elapsed since the start of the minute.
SecondOfTheMonth Calculate number of seconds elapsed since the start of the month.
SecondOfTheWeek Calculate the number of seconds elapsed since the start of the week.
SecondOfTheYear Calculate the number of seconds elapsed since the start of the year.
SecondsBetween Calculate the number of whole seconds between two TDateTime values.
SecondSpan Calculate the approximate number of seconds between two TDateTime values.
StartOfADay Returns the start of a day as a TDateTime value, given a day indication.
StartOfAMonth Return first date of month, given a year/month pair.
StartOfAWeek Return a day of the week, given a year, week and day in the week.
StartOfAYear Return the first day of a given year.
StartOfTheDay Calculate the start of the day as a TDateTime value, given a moment in the day.
StartOfTheMonth Calculate the first day of the month, given a date in that month.
StartOfTheWeek Return the first day of the week, given a date.
StartOfTheYear Return the first day of the year, given a date in this year.
TimeInRange Checks whether a time value is in a given range.
TimeOf Extract the time part from a TDateTime indication.
Today Return the current date.
Tomorrow Return the next day after today.
TryEncodeDateDay Encode a year and day of year to a TDateTime value.
TryEncodeDateMonthWeek Encode a year, month, week of month and day of week to a TDateTime value.
TryEncodeDateTime Encode a Year, Month, Day, Hour, minute, seconds, milliseconds tuplet to a TDateTime value.
TryEncodeDateWeek Encode a year, week and day of week triplet to a TDateTime value.
TryEncodeDayOfWeekInMonth Encode a year, month, week, day of week triplet to a TDateTime value.
TryEncodeTimeInterval Try to encode an interval as a TDateTime value.
TryISO8601ToDate Attempts to convert an ISO 8601-formatted date/time value to a TDateTime type.
TryISOStrToDate Attempts to convert an ISO 8601-formatted date value to a TDateTime type.
TryISOStrToDateTime Attempts to convert an ISO 8601-formatted date/time value to a TDateTime type.
TryISOStrToTime Converts an ISO 8601-formatted time value to a TDateTime type.
TryISOTZStrToTZOffset Attempts to convert an ISO 8601 time zone designation to an offset in minutes.
TryJulianDateToDateTime Convert a Julian date representation to a TDateTime value.
TryModifiedJulianDateToDateTime Convert a modified Julian date representation to a TDateTime value.
TryRecodeDateTime Replace selected parts of a TDateTime value with other values.
UniversalTimeToLocal Convert UTC time to local time.
UnixTimeStampToMac Convert Unix Timestamp to a Mac Timestamp.
UnixToDateTime Convert Unix epoch time to a TDateTime value.
WeekOf Extract week (of the year) from a given date.
WeekOfTheMonth Extract the week of the month (and optionally month and year) from a TDateTime value.
WeekOfTheYear Extract the week of the year (and optionally year) of a TDateTime indication.
WeeksBetween Calculate the number of whole weeks between two TDateTime values.
WeeksInAYear Returns the number of weeks in a given year.
WeeksInYear Returns the number of weeks in the year, given a date.
WeekSpan Calculate the approximate number of weeks between two TDateTime values.
WithinPastDays Check whether two TDateTimes are only a number of days apart.
WithinPastHours Check whether two TDateTimes are only a number of hours apart.
WithinPastMilliSeconds Check whether two TDateTimes are only a number of milliseconds apart.
WithinPastMinutes Check whether two TDateTimes are only a number of minutes apart.
WithinPastMonths Check whether two TDateTimes are only a number of months apart.
WithinPastSeconds Check whether two TDateTimes are only a number of seconds apart.
WithinPastWeeks Check whether two TDateTimes are only a number of weeks apart.
WithinPastYears Check whether two TDateTimes are only a number of years apart.
YearOf Extract the year from a given date.
YearsBetween Calculate the number of whole years between two TDateTime values.
YearSpan Calculate the approximate number of years between two TDateTime values.
Yesterday Return the previous day.