System.DateUtils

From RAD Studio API Documentation
Jump to: navigation, search


Package rtl290.bpl

Classes

EDateTimeException
ELocalTimeInvalidELocalTimeInvalid is the exception class for invalid local times.
TDateTimeHelper
TTimeZoneTTimeZone offers a set of tools for timezone support.

Routines

AdjustDateTime
CompareDateIndicates the relationship between the date portions of two TDateTime values.
CompareDateTimeIndicates the relationship between two TDateTime values.
CompareTimeIndicates the relationship between the time portions of two TDateTime values.
DateInRangeChecks whether a TDate value is in range.
DateOfStrips the time portion from a TDateTime value.
DateTimeInRangeChecks whether a TDateTime value is in range.
DateTimeToJulianDateConverts a TDateTime value into a Julian date.
DateTimeToMilliseconds
DateTimeToModifiedJulianDateConverts a TDateTime value into a modified Julian date.
DateTimeToUnixConverts a TDateTime value into a Unix/Linux-style date-and-time value.
DateToISO8601Converts the ADate date-and-time value, specified in the TDateTime format, into a string containing a date-and-time value in the ISO 8601 format.
DateToRFC822Converts a TDateTime value to RFC-822 format.
DayOfReturns the day of the month represented by a TDateTime value.
DayOfTheMonthReturns the day of the month represented by a TDateTime value.
DayOfTheWeekReturns the day of the week represented by a TDateTime value.
DayOfTheYearReturns the number of days between a specified TDateTime value and December 31 of the previous year.
DaysBetweenReturns the number of whole days between two specified TDateTime values.
DaysInAMonthReturns the number of days in a specified month of a specified year.
DaysInAYearReturns the number of days in a specified year.
DaysInMonthReturns the number of days in the month of a specified TDateTime value.
DaysInYearReturns the number of days in the year of a specified TDateTime value.
DaySpanReturns the number of days (including fractional days) between two specified TDateTime values.
DecodeDateDayReturns the year and day of the year for a specified TDateTime.
DecodeDateMonthWeekReturns the year, month, week of the month, and day of the week for a specified TDateTime.
DecodeDateTimeReturns Year, Month, Day, Hour, Minute, Second, and Millisecond values for a TDateTime.
DecodeDateWeekReturns the year, week of the year, and day of the week for a specified TDateTime value object.
DecodeDayOfWeekInMonthFor a given TDateTime value, returns the year, month, day of the week, and the count of that day of the week in the month.
EncodeDateDayReturns a TDateTime that represents a specified day of the year for a specified year.
EncodeDateMonthWeekReturns a TDateTime that represents a specified day of a specified week in a specified month and year.
EncodeDateTimeReturns a TDateTime that represents a specified year, month, day, hour, minute, second, and millisecond.
EncodeDateWeekReturns a TDateTime that represents a specified day of a specified week in a specified year.
EncodeDayOfWeekInMonthReturns a TDateTime that represents a specified occurrence of a day of the week within a specified month and year.
EndOfADayReturns a TDateTime that represents the last millisecond of a specified day.
EndOfAMonthReturns a TDateTime that represents the last millisecond of the last day of a specified month.
EndOfAWeekReturns a TDateTime object value that represents the last millisecond of a specified day of a specified week.
EndOfAYearReturns a TDateTime that represents the last millisecond of a specified year.
EndOfTheDayReturns a TDateTime that represents the last millisecond of the day identified by a specified TDateTime.
EndOfTheMonthReturns a TDateTime that represents the last millisecond of the last day of the month identified by a specified TDateTime.
EndOfTheWeekReturns a TDateTime that represents the last millisecond of the last day of the week identified by a specified TDateTime.
EndOfTheYearReturns a TDateTime that represents the last millisecond of the last day of the year identified by a specified TDateTime.
HourOfReturns the hour of the day represented by a TDateTime value.
HourOfTheDayReturns the hour of the day represented by a TDateTime value.
HourOfTheMonthReturns the number of hours between a specified TDateTime value and 12:00 A.M. of the first day of the month.
HourOfTheWeekReturns the number of hours between a specified TDateTime value and 12:00 A.M. of the first day of the week.
HourOfTheYearReturns the number of hours between a specified TDateTime value and 12:00 A.M. of the first day of the year.
HoursBetweenReturns the number of whole hours between two specified TDateTime values.
HourSpanReturns the number of hours (including fractional hours) between two specified TDateTime values.
HttpToDate
IncDayReturns a date shifted by a specified number of days.
IncHourReturns a date/time value shifted by a specified number of hours.
IncMilliSecondReturns a date/time value shifted by a specified number of milliseconds.
IncMinuteReturns a date/time value shifted by a specified number of minutes.
IncSecondReturns a date/time value shifted by a specified number of seconds.
IncWeekReturns a date shifted by a specified number of weeks.
IncYearReturns a date shifted by a specified number of years.
InvalidDateDayErrorInvalidDateDayError is used internally.
InvalidDateMonthWeekErrorInvalidDateMonthWeekError is used internally.
InvalidDateTimeErrorInvalidDateTimeError is used internally.
InvalidDateWeekErrorInvalidDateWeekError is used internally.
InvalidDayOfWeekInMonthErrorInvalidDayOfWeekInMonthError is used internally.
IsAMIndicates whether the time portion of a specified TDateTime value occurs before noon.
IsInLeapYearIndicates whether a specified TDateTime value occurs in a leap year.
ISO8601ToDateConverts the AISODate date-and-time value, specified in the ISO 8601 format, into the date-and-time value in the TDateTime format.
IsPMIndicates whether the time portion of a specified TDateTime value occurs in the afternoon.
IsSameDayIndicates whether a specified TDateTime value occurs on a the same day as a criterion date.
IsTodayIndicates whether a specified TDateTime value occurs on the current date.
IsValidDateIndicates whether a specified year, month, and day represent a valid date.
IsValidDateDayIndicates whether a specified year and day of the year represent a valid date.
IsValidDateMonthWeekIndicates whether a specified year, month, week of the month, and day of the week represent a valid date.
IsValidDateTimeIndicates whether a specified year, month, day, hour, minute, second, and millisecond represent a valid date and time.
IsValidDateWeekIndicates whether a specified year, week of the year, and day of the week represent a valid date.
IsValidTimeIndicates whether a specified hour, minute, second, and millisecond represent a valid date and time.
JulianDateToDateTimeConverts a Julian date to a TDateTime value.
MilliSecondOfReturns the millisecond of the second represented by a TDateTime value.
MilliSecondOfTheDayReturns the number of milliseconds between a specified TDateTime value and the beginning of the same day.
MilliSecondOfTheHourReturns the number of milliseconds between a specified TDateTime value and the beginning of the same hour.
MilliSecondOfTheMinuteReturns the number of milliseconds between a specified TDateTime value and the beginning of the same minute.
MilliSecondOfTheMonthReturns the number of milliseconds between a specified TDateTime value and the beginning of the month.
MilliSecondOfTheSecondReturns the millisecond of the second represented by a TDateTime value.
MilliSecondOfTheWeekReturns the number of milliseconds between a specified TDateTime value and 12:00:00:00 A.M. of the first day of the week.
MilliSecondOfTheYearReturns the number of milliseconds between a specified TDateTime value and 12:00:00:00 A.M. of the first day of the year.
MilliSecondsBetweenReturns the number of milliseconds between two specified TDateTime values.
MilliSecondSpanReturns the number of milliseconds between two specified TDateTime values.
MinuteOfReturns the minute of the hour represented by a TDateTime value.
MinuteOfTheDayReturns the number of minutes between a specified TDateTime value and 12:00 A.M. of the same day.
MinuteOfTheHourReturns the number of minutes between a specified TDateTime value and the beginning of the same hour.
MinuteOfTheMonthReturns the number of minutes between a specified TDateTime value and 12:00 A.M. of the first day of the month.
MinuteOfTheWeekReturns the number of minutes between a specified TDateTime value and 12:00 A.M. of the first day of the week.
MinuteOfTheYearReturns the number of minutes between a specified TDateTime value and 12:00 A.M. of the first day of the year.
MinutesBetweenReturns the number of minutes between two specified TDateTime values.
MinuteSpanReturns the number of minutes, including fractions thereof, between two specified TDateTime values.
ModifiedJulianDateToDateTimeConverts a modified Julian date to a TDateTime value.
MonthOfReturns the month of the year represented by a TDateTime value.
MonthOfTheYearReturns the month of the year represented by a TDateTime value.
MonthsBetweenReturns the approximate number of months between two specified TDateTime values.
MonthSpanReturns the approximate number of months, including fractions, between two specified TDateTime values.
NthDayOfWeekReturns the weekday of the specified TDateTime value.
RecodeDateSelectively replaces the date parts of a specified TDateTime value.
RecodeDateTimeSelectively replaces parts of a specified TDateTime value.
RecodeDayReplaces the day of the month for a specified TDateTime value.
RecodeHourReplaces the hour of the day for a specified TDateTime value.
RecodeMilliSecondReplaces the millisecond of the second for a specified TDateTime value.
RecodeMinuteReplaces the minute of the hour for a specified TDateTime value.
RecodeMonthReplaces the month of the year for a specified TDateTime value.
RecodeSecondReplaces the second of the minute for a specified TDateTime value.
RecodeTimeSelectively replaces the time parts of a specified TDateTime value.
RecodeYearReplaces the year for a specified TDateTime value.
RFC822ToDate
SameDateIndicates whether two TDateTime values represent the same year, month, and day.
SameDateTimeIndicates whether two TDateTime values represent the same year, month, day, hour, minute, second, and millisecond.
SameTimeIndicates whether two TDateTime values represent the same time of day, ignoring the date portion.
SecondOfReturns the second of the minute represented by a TDateTime value.
SecondOfTheDayReturns the number of seconds between a specified TDateTime value and 12:00:00 A.M. of the same day.
SecondOfTheHourReturns the number of seconds between a specified TDateTime value and the beginning of the same hour.
SecondOfTheMinuteReturns the number of seconds between a specified TDateTime value and the beginning of the same minute.
SecondOfTheMonthReturns the number of seconds between a specified TDateTime value and 12:00:00 A.M. on the first day of the month.
SecondOfTheWeekReturns the number of seconds between a specified TDateTime value and 12:00:00 A.M. of the first day of the week.
SecondOfTheYearReturns the number of seconds between a specified TDateTime value and 12:00:00 A.M. on the first day of the year.
SecondsBetweenReturns the number of seconds between two specified TDateTime values.
SecondSpanReturns the number of seconds (including fractions thereof) between two specified TDateTime values.
StartOfADayReturns a TDateTime that represents 12:00:00:00 A.M. on a specified day.
StartOfAMonthReturns a TDateTime that represents 12:00:00:00 A.M. on the first day of a specified month.
StartOfAWeekReturns a TDateTime that represents the first moment on a specified day of a specified week.
StartOfAYearReturns a TDateTime that represents the first moment on the first day of a specified year.
StartOfTheDayReturns a TDateTime that represents 12:00:00:00 A.M. on the day identified by a specified TDateTime.
StartOfTheMonthReturns a TDateTime that represents 12:00:00:00 A.M. on the first day of the month identified by a specified TDateTime.
StartOfTheWeekReturns a TDateTime that represents 12:00:00:00 A.M. on the first day of the week identified by a specified TDateTime.
StartOfTheYearReturns a TDateTime that represents 12:00:00:00 A.M. on the first day of the year identified by a specified TDateTime.
TimeInRangeChecks whether a TDateTime value is in range.
TimeOfStrips the date portion from a TDateTime value.
TimeToMilliseconds
TodayReturns a TDateTime value that represents the current date.
TomorrowReturns a TDateTime value that represents the following day.
TryEncodeDateDayCalculates the TDateTime value that represents a specified day of the year for a specified year.
TryEncodeDateMonthWeekCalculates the TDateTime value that represents a specified day of a specified week in a specified month and year.
TryEncodeDateTimeCalculates the TDateTime value that represents a specified year, month, day, hour, minute, second, and millisecond.
TryEncodeDateWeekCalculates the TDateTime value that represents a specified day of a specified week in a specified year.
TryEncodeDayOfWeekInMonthCalculates a TDateTime that represents a specified occurrence of a day of the week within a specified month and year.
TryISO8601ToDateTries to convert the provided date-and-time value, specified in the ISO 8601 format, into the date-and-time value in the TDateTime format. Returns True if the conversion succeeds.
TryJulianDateToDateTimeConverts a Julian date to a TDateTime value.
TryModifiedJulianDateToDateTimeConverts a modified Julian date to a TDateTime value.
TryRecodeDateTimeSelectively replaces parts of a specified TDateTime value.
TryRFC822ToDate
UnixToDateTimeConverts a Unix/Linux style date-and-time value to a TDateTime value.
WeekOfReturns the week of the year represented by a TDateTime value.
WeekOfTheMonthReturns the week of the month represented by a TDateTime value.
WeekOfTheYearReturns the week of the year represented by a TDateTime value.
WeeksBetweenReturns the number of whole weeks between two specified TDateTime values.
WeeksInAYearReturns the number of weeks in a specified year.
WeeksInYearReturns the number of weeks in the year of a specified TDateTime value.
WeekSpanReturns the number of weeks (including fractional weeks) between two specified TDateTime values.
WithinPastDaysIndicates whether two dates are within a specified number of days of each other.
WithinPastHoursIndicates whether two date/time values are within a specified number of hours of each other.
WithinPastMilliSecondsIndicates whether two date/time values are within a specified number of milliseconds of each other.
WithinPastMinutesIndicates whether two date/time values are within a specified number of minutes of each other.
WithinPastMonthsIndicates whether two date/time values are within a specified number of months of each other.
WithinPastSecondsIndicates whether two date/time values are within a specified number of seconds of each other.
WithinPastWeeksIndicates whether two date/time values are within a specified number of weeks of each other.
WithinPastYearsIndicates whether two date/time values are within a specified number of years of each other.
YearOfReturns the year represented by a TDateTime value.
YearsBetweenReturns the approximate number of years between two specified TDateTime values.
YearSpanReturns the approximate number of years (including fractions thereof) between two specified TDateTime values.
YesterdayReturns a TDateTime value that represents the preceding day.

Types

TISO8601ToDateOption
TISO8601ToDateOptions
TLocalTimeTypeSpecifies the type of a date and time value.
TRFC822ToDateOption
TRFC822ToDateOptions

Variables

ApproxDaysPerMonthApproxDaysPerMonth represents the approximate number of days in a month, over a normal four-year period.
ApproxDaysPerYearApproxDaysPerYear represents the approximate number of days in a year, over a normal four-year period.
DaysPerYearDaysPerYear represents the number of days in a year.
ENUSFormatSettings
EpochAsJulianDate
OneHour
OneMillisecond
OneMinute
OneSecond

Constants

DayFridayDayFriday: Integer = 5;
DayMondayDayMonday: Integer = 1;
DaySaturdayDaySaturday: Integer = 6;
DaysPerWeekDaysPerWeek: Integer = 7;
DaySundayDaySunday: Integer = 7;
DayThursdayDayThursday: Integer = 4;
DayTuesdayDayTuesday: Integer = 2;
DayWednesdayDayWednesday: Integer = 3;
EpochAsUnixDateEpochAsUnixDate: Int64 = $FFFFFFFF7C52DE80;
MonthAprilMonthApril: Integer = 4;
MonthAugustMonthAugust: Integer = 8;
MonthDecemberMonthDecember: Integer = $C;
MonthFebruaryMonthFebruary: Integer = 2;
MonthJanuaryMonthJanuary: Integer = 1;
MonthJulyMonthJuly: Integer = 7;
MonthJuneMonthJune: Integer = 6;
MonthMarchMonthMarch: Integer = 3;
MonthMayMonthMay: Integer = 5;
MonthNovemberMonthNovember: Integer = $B;
MonthOctoberMonthOctober: Integer = $A;
MonthSeptemberMonthSeptember: Integer = 9;
MonthsPerYearMonthsPerYear: Integer = $C;
RecodeLeaveFieldAsIsRecodeLeaveFieldAsIs: Integer = $FFFF;
WeeksPerFortnightWeeksPerFortnight: Integer = 2;
YearsPerCenturyYearsPerCentury: Integer = $64;
YearsPerDecadeYearsPerDecade: Integer = $A;
YearsPerMillenniumYearsPerMillennium: Integer = $3E8;