ChronoKit-FP API reference
Generated from public
TChronoKitdeclaration comments bytools/GenerateApiReference.ps1. Do not edit this file manually.
Search this page by task or method name. For a guided introduction, start with the learning path.
Preferred TChronoKit methods#
| Method | Declaration | Contract summary |
|---|---|---|
GetNow | class function GetNow: TDateTime; static; | Returns the current system date and time as a TDateTime value. This includes both the date and time portions. |
GetToday | class function GetToday: TDateTime; static; | Returns just the current date, with the time set to midnight (00:00:00.000). |
FormatDateTime | class function FormatDateTime(const AValue: TDateTime; const AFormat: string = ''): string; static; | Formats a TDateTime value as text. This is the preferred, task-oriented name for the established GetAsString behavior. |
ParseDateTime | class function ParseDateTime(const AValue: string; const AFormat: string = ''): TDateTime; static; | Parses text as a TDateTime value. This is the preferred, task-oriented name for the established FromString behavior. |
GetYear | class function GetYear(const AValue: TDateTime): Integer; static; | Extracts the year component from a TDateTime value. |
GetMonth | class function GetMonth(const AValue: TDateTime): Integer; static; | Extracts the month component (1-12) from a TDateTime value. |
GetDay | class function GetDay(const AValue: TDateTime): Integer; static; | Extracts the day of the month (1-31) from a TDateTime value. |
GetDayOfWeek | class function GetDayOfWeek(const AValue: TDateTime): Integer; static; | Returns the day of the week for a given date. |
GetDayOfYear | class function GetDayOfYear(const AValue: TDateTime): Integer; static; | Calculates the day number within the year (1-366). |
GetHour | class function GetHour(const AValue: TDateTime): Integer; static; | Extracts the hour component (0-23) from a TDateTime value. |
GetMinute | class function GetMinute(const AValue: TDateTime): Integer; static; | Extracts the minute component (0-59) from a TDateTime value. |
GetSecond | class function GetSecond(const AValue: TDateTime): Integer; static; | Extracts the second component (0-59) from a TDateTime value. |
GetMillisecond | class function GetMillisecond(const AValue: TDateTime): Integer; static; | Extracts the millisecond component (0-999) from a TDateTime value. |
SetYear | class function SetYear(const AValue: TDateTime; const AYear: Integer): TDateTime; static; | Creates a new TDateTime value with the year component replaced. Other components (month, day, time) remain the same. |
SetMonth | class function SetMonth(const AValue: TDateTime; const AMonth: Integer): TDateTime; static; | Creates a new TDateTime value with the month component replaced. Other components (year, day, time) remain the same. |
SetDay | class function SetDay(const AValue: TDateTime; const ADay: Integer): TDateTime; static; | Creates a new TDateTime value with the day of the month replaced. Other components (year, month, time) remain the same. |
SetHour | class function SetHour(const AValue: TDateTime; const AHour: Integer): TDateTime; static; | Creates a new TDateTime value with the hour component replaced. Other components (date, minute, second, millisecond) remain the same. |
SetMinute | class function SetMinute(const AValue: TDateTime; const AMinute: Integer): TDateTime; static; | Creates a new TDateTime value with the minute component replaced. Other components (date, hour, second, millisecond) remain the same. |
SetSecond | class function SetSecond(const AValue: TDateTime; const ASecond: Integer): TDateTime; static; | Creates a new TDateTime value with the second component replaced. Other components (date, hour, minute, millisecond) remain the same. |
SetMilliSecond | class function SetMilliSecond(const AValue: TDateTime; const AMilliSecond: Integer): TDateTime; static; | Creates a new TDateTime value with the millisecond component replaced. Other components (date, hour, minute, second) remain the same. |
AddYears | class function AddYears(const AValue: TDateTime; const AYears: Integer): TDateTime; static; | Adds (or subtracts if negative) a specified number of years to a TDateTime value. Attempts to preserve the month and day. |
AddMonths | class function AddMonths(const AValue: TDateTime; const AMonths: Integer): TDateTime; static; | Adds (or subtracts if negative) a specified number of months to a TDateTime value. Attempts to preserve the day, adjusting if necessary (e.g., Jan 31 + 1 month -> Feb 28/29). |
AddDays | class function AddDays(const AValue: TDateTime; const ADays: Integer): TDateTime; static; | Adds (or subtracts if negative) a specified number of days to a TDateTime value. |
AddHours | class function AddHours(const AValue: TDateTime; const AHours: Integer): TDateTime; static; | Adds (or subtracts if negative) a specified number of hours to a TDateTime value. |
AddMinutes | class function AddMinutes(const AValue: TDateTime; const AMinutes: Integer): TDateTime; static; | Adds (or subtracts if negative) a specified number of minutes to a TDateTime value. |
AddSeconds | class function AddSeconds(const AValue: TDateTime; const ASeconds: Integer): TDateTime; static; | Adds (or subtracts if negative) a specified number of seconds to a TDateTime value. |
StartOfYear | class function StartOfYear(const AValue: TDateTime): TDateTime; static; | Returns the first moment of the year (January 1st, 00:00:00.000) for the year of the given date. |
StartOfMonth | class function StartOfMonth(const AValue: TDateTime): TDateTime; static; | Returns the first moment of the month (1st day, 00:00:00.000) for the month of the given date. |
StartOfWeek | class function StartOfWeek(const AValue: TDateTime): TDateTime; static; | Returns the first moment of the week (Sunday, 00:00:00.000) for the week containing the given date. |
StartOfDay | class function StartOfDay(const AValue: TDateTime): TDateTime; static; | Returns the first moment of the day (00:00:00.000) for the given date. Effectively removes the time portion. |
StartOfHour | class function StartOfHour(const AValue: TDateTime): TDateTime; static; | Returns the first moment of the hour (minute=0, second=0, millisecond=0) for the given date/time. |
EndOfYear | class function EndOfYear(const AValue: TDateTime): TDateTime; static; | Returns the last moment of the year (December 31st, 23:59:59.999) for the year of the given date. |
EndOfMonth | class function EndOfMonth(const AValue: TDateTime): TDateTime; static; | Returns the last moment of the month (last day, 23:59:59.999) for the month of the given date. |
EndOfWeek | class function EndOfWeek(const AValue: TDateTime): TDateTime; static; | Returns the last moment of the week (Saturday, 23:59:59.999) for the week containing the given date. |
EndOfDay | class function EndOfDay(const AValue: TDateTime): TDateTime; static; | Returns the last moment of the day (23:59:59.999) for the given date. |
EndOfHour | class function EndOfHour(const AValue: TDateTime): TDateTime; static; | Returns the last moment of the hour (minute=59, second=59, millisecond=999) for the given date/time. |
IsBefore | class function IsBefore(const AValue, ADateTime: TDateTime): Boolean; static; | Checks if the first TDateTime value occurs chronologically before the second. |
IsAfter | class function IsAfter(const AValue, ADateTime: TDateTime): Boolean; static; | Checks if the first TDateTime value occurs chronologically after the second. |
IsSameDay | class function IsSameDay(const AValue, ADateTime: TDateTime): Boolean; static; | Checks if two TDateTime values fall on the same calendar day, ignoring the time portion. |
IsSameMonth | class function IsSameMonth(const AValue, ADateTime: TDateTime): Boolean; static; | Checks if two TDateTime values fall within the same calendar month and year. |
IsSameYear | class function IsSameYear(const AValue, ADateTime: TDateTime): Boolean; static; | Checks if two TDateTime values fall within the same calendar year. |
CreateBusinessCalendar | class function CreateBusinessCalendar( const AHolidays: array of TDateTime): TBusinessCalendar; overload; static; | Creates business-calendar rules from holidays and an optional explicit working week. The one-parameter overload uses Monday through Friday. |
CreateBusinessCalendar | class function CreateBusinessCalendar(const AWorkingDays: TBusinessWeek; const AHolidays: array of TDateTime): TBusinessCalendar; overload; static; | Creates business-calendar rules from holidays and an optional explicit working week. The one-parameter overload uses Monday through Friday. |
IsBusinessDay | class function IsBusinessDay(const AValue: TDateTime): Boolean; overload; static; | Checks whether a date is a business day. Without a calendar, Monday through Friday are business days. The calendar overload also applies its working week and holidays. |
IsBusinessDay | class function IsBusinessDay(const AValue: TDateTime; const ACalendar: TBusinessCalendar): Boolean; overload; static; | Checks whether a date is a business day. Without a calendar, Monday through Friday are business days. The calendar overload also applies its working week and holidays. |
NextBusinessDay | class function NextBusinessDay(const AValue: TDateTime): TDateTime; overload; static; | Finds the next business day strictly after the given date. The calendar overload applies configured weekdays and holidays. |
NextBusinessDay | class function NextBusinessDay(const AValue: TDateTime; const ACalendar: TBusinessCalendar): TDateTime; overload; static; | Finds the next business day strictly after the given date. The calendar overload applies configured weekdays and holidays. |
PreviousBusinessDay | class function PreviousBusinessDay(const AValue: TDateTime): TDateTime; overload; static; | Finds the previous business day strictly before the given date. The calendar overload applies configured weekdays and holidays. |
PreviousBusinessDay | class function PreviousBusinessDay(const AValue: TDateTime; const ACalendar: TBusinessCalendar): TDateTime; overload; static; | Finds the previous business day strictly before the given date. The calendar overload applies configured weekdays and holidays. |
AddBusinessDays | class function AddBusinessDays(const AValue: TDateTime; const ADays: Integer): TDateTime; overload; static; | Adds or subtracts business days. The calendar overload applies configured weekdays and holidays. |
AddBusinessDays | class function AddBusinessDays(const AValue: TDateTime; const ADays: Integer; const ACalendar: TBusinessCalendar): TDateTime; overload; static; | Adds or subtracts business days. The calendar overload applies configured weekdays and holidays. |
BusinessDaysBetween | class function BusinessDaysBetween(const AStartDate, AEndDate: TDateTime): Integer; overload; static; | Counts business calendar dates in the inclusive interval. Time portions are ignored. Reversed calendar-date endpoints return the negative of the forward count. |
BusinessDaysBetween | class function BusinessDaysBetween(const AStartDate, AEndDate: TDateTime; const ACalendar: TBusinessCalendar): Integer; overload; static; | Counts business calendar dates in the inclusive interval. Time portions are ignored. Reversed calendar-date endpoints return the negative of the forward count. |
GetQuarter | class function GetQuarter(const AValue: TDateTime): Integer; static; | Returns the calendar quarter (1-4) for the given date. |
StartOfQuarter | class function StartOfQuarter(const AYear, AQuarter: Integer): TDateTime; overload; static; | See the declaration contract and linked executable example. |
StartOfQuarter | class function StartOfQuarter(const AValue: TDateTime): TDateTime; overload; static; | Returns midnight on the first date of AValue's quarter. The input time portion is ignored. |
EndOfQuarter | class function EndOfQuarter(const AValue: TDateTime): TDateTime; static; | Returns the final millisecond of AValue's calendar quarter. The input time portion is ignored. |
IsAM | class function IsAM(const AValue: TDateTime): Boolean; static; | Checks if the time portion of a TDateTime value is in the AM (before 12:00:00 noon). |
IsPM | class function IsPM(const AValue: TDateTime): Boolean; static; | Checks if the time portion of a TDateTime value is in the PM (12:00:00 noon or later). |
FloorDate | class function FloorDate(const AValue: TDateTime; const AUnit: TDateUnit): TDateTime; static; | Rounds a TDateTime value down to the nearest specified time unit. Essentially sets lower-order time components to their minimum value. |
CeilingDate | class function CeilingDate(const AValue: TDateTime; const AUnit: TDateUnit): TDateTime; static; | Rounds a TDateTime value up to the beginning of the next specified time unit. |
CreateCalendarPeriod | class function CreateCalendarPeriod(const AYears: Integer = 0; const AMonths: Integer = 0; const ADays: Integer = 0; const AHours: Integer = 0; const AMinutes: Integer = 0; const ASeconds: Integer = 0; const AMilliseconds: Integer = 0): TCalendarPeriod; static; | See the declaration contract and linked executable example. |
NormalizeCalendarPeriod | class function NormalizeCalendarPeriod( const AValue: TCalendarPeriod): TCalendarPeriod; static; | See the declaration contract and linked executable example. |
DurationFromParts | class function DurationFromParts(const ADays: Int64 = 0; const AHours: Int64 = 0; const AMinutes: Int64 = 0; const ASeconds: Int64 = 0; const AMilliseconds: Int64 = 0): TDuration; static; | See the declaration contract and linked executable example. |
DurationFromSeconds | class function DurationFromSeconds( const ASeconds: Int64): TDuration; static; | See the declaration contract and linked executable example. |
AddPeriod | class function AddPeriod(const AValue: TDateTime; const APeriod: TCalendarPeriod): TDateTime; static; | See the declaration contract and linked executable example. |
SubtractPeriod | class function SubtractPeriod(const AValue: TDateTime; const APeriod: TCalendarPeriod): TDateTime; static; | See the declaration contract and linked executable example. |
AddDuration | class function AddDuration(const AValue: TDateTime; const ADuration: TDuration): TDateTime; static; | See the declaration contract and linked executable example. |
SubtractDuration | class function SubtractDuration(const AValue: TDateTime; const ADuration: TDuration): TDateTime; static; | See the declaration contract and linked executable example. |
DurationBetween | class function DurationBetween(const AStart, AEnd: TDateTime): TDuration; static; | See the declaration contract and linked executable example. |
CreateRange | class function CreateRange(const AStart, AEnd: TDateTime): TDateTimeRange; static; | See the declaration contract and linked executable example. |
RangeContains | class function RangeContains(const ARange: TDateTimeRange; const AValue: TDateTime): Boolean; static; | See the declaration contract and linked executable example. |
RangesOverlap | class function RangesOverlap(const AFirst, ASecond: TDateTimeRange): Boolean; static; | See the declaration contract and linked executable example. |
RangeDuration | class function RangeDuration( const ARange: TDateTimeRange): TDuration; static; | See the declaration contract and linked executable example. |
RangesTouch | class function RangesTouch(const AFirst, ASecond: TDateTimeRange): Boolean; static; | See the declaration contract and linked executable example. |
RangeGap | class function RangeGap(const AFirst, ASecond: TDateTimeRange): TDuration; static; | See the declaration contract and linked executable example. |
SubtractRange | class function SubtractRange(const AValue, ARemove: TDateTimeRange): TDateTimeRangeArray; static; | See the declaration contract and linked executable example. |
TryMergeRanges | class function TryMergeRanges(const AFirst, ASecond: TDateTimeRange; out AMerged: TDateTimeRange): Boolean; static; | See the declaration contract and linked executable example. |
TryIntersectRanges | class function TryIntersectRanges(const AFirst, ASecond: TDateTimeRange; out AIntersection: TDateTimeRange): Boolean; static; | See the declaration contract and linked executable example. |
DecimalYearToDateTime | class function DecimalYearToDateTime( const AValue: Double): TDateTime; static; | Converts a decimal year to a date/time. The fractional part is measured across the actual number of days in that year. |
DateTimeToDecimalYear | class function DateTimeToDecimalYear( const AValue: TDateTime): Double; static; | Converts a date/time to a decimal year, including its time-of-day fraction. |
GetISOYear | class function GetISOYear(const AValue: TDateTime): Integer; static; | Returns the ISO year (week-based year) for a given TDateTime value. |
GetISOWeek | class function GetISOWeek(const AValue: TDateTime): Integer; static; | Returns the ISO week number (week of the year) for a given TDateTime value. |
GetSemester | class function GetSemester(const AValue: TDateTime): Integer; static; | Returns the semester (1 or 2) for a given TDateTime value. |
RoundDate | class function RoundDate(const AValue: TDateTime; const AUnit: TDateUnit): TDateTime; static; | Rounds a TDateTime value to the nearest specified time unit. |
GetSystemTimeZoneInfo | class function GetSystemTimeZoneInfo( const AValue: TDateTime): TTimeZoneInfo; static; | See the declaration contract and linked executable example. |
GetSystemTimeZone | class function GetSystemTimeZone: string; static; | Retrieves the system's current time zone as a string. |
GetTimeZoneNames | class function GetTimeZoneNames: TStringArray; static; | Retrieves an array of all available time zone names. |
IsValidTimeZoneName | class function IsValidTimeZoneName(const ATimeZone: string): Boolean; static; | Checks if a given string is a valid timezone name known to the system. |
IsValidUTCOffset | class function IsValidUTCOffset(const AOffset: Integer): Boolean; static; | Checks if a given integer represents a valid UTC offset in minutes. |
ValidateTimeZone | class function ValidateTimeZone(const ATimeZone: string): string; static; | Validates a timezone name, raising an exception if invalid. |
ValidateTimeZoneOffset | class function ValidateTimeZoneOffset(const AOffset: Integer): Integer; static; | Validates a UTC offset in minutes, raising an exception if invalid. |
SystemLocalToTimeZone | class function SystemLocalToTimeZone(const AValue: TDateTime; const ATimeZone: string): TDateTime; static; | See the declaration contract and linked executable example. |
TimeZoneToSystemLocal | class function TimeZoneToSystemLocal(const AValue: TDateTime; const ATimeZone: string): TDateTime; static; | See the declaration contract and linked executable example. |
ConvertBetweenTimeZones | class function ConvertBetweenTimeZones(const AValue: TDateTime; const ASourceTimeZone, ATargetTimeZone: string): TDateTime; static; | Interprets AValue as a wall clock in ASourceTimeZone and returns the target-zone wall clock for the same instant. The returned TDateTime has no stored timezone identity. |