ChronoKit-FP API reference

Generated from public TChronoKit declaration comments by tools/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#

MethodDeclarationContract summary
GetNowclass function GetNow: TDateTime; static;Returns the current system date and time as a TDateTime value. This includes both the date and time portions.
GetTodayclass function GetToday: TDateTime; static;Returns just the current date, with the time set to midnight (00:00:00.000).
FormatDateTimeclass 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.
ParseDateTimeclass 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.
GetYearclass function GetYear(const AValue: TDateTime): Integer; static;Extracts the year component from a TDateTime value.
GetMonthclass function GetMonth(const AValue: TDateTime): Integer; static;Extracts the month component (1-12) from a TDateTime value.
GetDayclass function GetDay(const AValue: TDateTime): Integer; static;Extracts the day of the month (1-31) from a TDateTime value.
GetDayOfWeekclass function GetDayOfWeek(const AValue: TDateTime): Integer; static;Returns the day of the week for a given date.
GetDayOfYearclass function GetDayOfYear(const AValue: TDateTime): Integer; static;Calculates the day number within the year (1-366).
GetHourclass function GetHour(const AValue: TDateTime): Integer; static;Extracts the hour component (0-23) from a TDateTime value.
GetMinuteclass function GetMinute(const AValue: TDateTime): Integer; static;Extracts the minute component (0-59) from a TDateTime value.
GetSecondclass function GetSecond(const AValue: TDateTime): Integer; static;Extracts the second component (0-59) from a TDateTime value.
GetMillisecondclass function GetMillisecond(const AValue: TDateTime): Integer; static;Extracts the millisecond component (0-999) from a TDateTime value.
SetYearclass 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.
SetMonthclass 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.
SetDayclass 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.
SetHourclass 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.
SetMinuteclass 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.
SetSecondclass 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.
SetMilliSecondclass 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.
AddYearsclass 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.
AddMonthsclass 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).
AddDaysclass function AddDays(const AValue: TDateTime; const ADays: Integer): TDateTime; static;Adds (or subtracts if negative) a specified number of days to a TDateTime value.
AddHoursclass function AddHours(const AValue: TDateTime; const AHours: Integer): TDateTime; static;Adds (or subtracts if negative) a specified number of hours to a TDateTime value.
AddMinutesclass function AddMinutes(const AValue: TDateTime; const AMinutes: Integer): TDateTime; static;Adds (or subtracts if negative) a specified number of minutes to a TDateTime value.
AddSecondsclass function AddSeconds(const AValue: TDateTime; const ASeconds: Integer): TDateTime; static;Adds (or subtracts if negative) a specified number of seconds to a TDateTime value.
StartOfYearclass 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.
StartOfMonthclass 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.
StartOfWeekclass 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.
StartOfDayclass 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.
StartOfHourclass 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.
EndOfYearclass 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.
EndOfMonthclass 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.
EndOfWeekclass 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.
EndOfDayclass function EndOfDay(const AValue: TDateTime): TDateTime; static;Returns the last moment of the day (23:59:59.999) for the given date.
EndOfHourclass 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.
IsBeforeclass function IsBefore(const AValue, ADateTime: TDateTime): Boolean; static;Checks if the first TDateTime value occurs chronologically before the second.
IsAfterclass function IsAfter(const AValue, ADateTime: TDateTime): Boolean; static;Checks if the first TDateTime value occurs chronologically after the second.
IsSameDayclass function IsSameDay(const AValue, ADateTime: TDateTime): Boolean; static;Checks if two TDateTime values fall on the same calendar day, ignoring the time portion.
IsSameMonthclass function IsSameMonth(const AValue, ADateTime: TDateTime): Boolean; static;Checks if two TDateTime values fall within the same calendar month and year.
IsSameYearclass function IsSameYear(const AValue, ADateTime: TDateTime): Boolean; static;Checks if two TDateTime values fall within the same calendar year.
CreateBusinessCalendarclass 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.
CreateBusinessCalendarclass 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.
IsBusinessDayclass 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.
IsBusinessDayclass 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.
NextBusinessDayclass 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.
NextBusinessDayclass 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.
PreviousBusinessDayclass 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.
PreviousBusinessDayclass 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.
AddBusinessDaysclass function AddBusinessDays(const AValue: TDateTime; const ADays: Integer): TDateTime; overload; static;Adds or subtracts business days. The calendar overload applies configured weekdays and holidays.
AddBusinessDaysclass 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.
BusinessDaysBetweenclass 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.
BusinessDaysBetweenclass 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.
GetQuarterclass function GetQuarter(const AValue: TDateTime): Integer; static;Returns the calendar quarter (1-4) for the given date.
StartOfQuarterclass function StartOfQuarter(const AYear, AQuarter: Integer): TDateTime; overload; static;See the declaration contract and linked executable example.
StartOfQuarterclass function StartOfQuarter(const AValue: TDateTime): TDateTime; overload; static;Returns midnight on the first date of AValue's quarter. The input time portion is ignored.
EndOfQuarterclass function EndOfQuarter(const AValue: TDateTime): TDateTime; static;Returns the final millisecond of AValue's calendar quarter. The input time portion is ignored.
IsAMclass 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).
IsPMclass 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).
FloorDateclass 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.
CeilingDateclass function CeilingDate(const AValue: TDateTime; const AUnit: TDateUnit): TDateTime; static;Rounds a TDateTime value up to the beginning of the next specified time unit.
CreateCalendarPeriodclass 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.
NormalizeCalendarPeriodclass function NormalizeCalendarPeriod( const AValue: TCalendarPeriod): TCalendarPeriod; static;See the declaration contract and linked executable example.
DurationFromPartsclass 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.
DurationFromSecondsclass function DurationFromSeconds( const ASeconds: Int64): TDuration; static;See the declaration contract and linked executable example.
AddPeriodclass function AddPeriod(const AValue: TDateTime; const APeriod: TCalendarPeriod): TDateTime; static;See the declaration contract and linked executable example.
SubtractPeriodclass function SubtractPeriod(const AValue: TDateTime; const APeriod: TCalendarPeriod): TDateTime; static;See the declaration contract and linked executable example.
AddDurationclass function AddDuration(const AValue: TDateTime; const ADuration: TDuration): TDateTime; static;See the declaration contract and linked executable example.
SubtractDurationclass function SubtractDuration(const AValue: TDateTime; const ADuration: TDuration): TDateTime; static;See the declaration contract and linked executable example.
DurationBetweenclass function DurationBetween(const AStart, AEnd: TDateTime): TDuration; static;See the declaration contract and linked executable example.
CreateRangeclass function CreateRange(const AStart, AEnd: TDateTime): TDateTimeRange; static;See the declaration contract and linked executable example.
RangeContainsclass function RangeContains(const ARange: TDateTimeRange; const AValue: TDateTime): Boolean; static;See the declaration contract and linked executable example.
RangesOverlapclass function RangesOverlap(const AFirst, ASecond: TDateTimeRange): Boolean; static;See the declaration contract and linked executable example.
RangeDurationclass function RangeDuration( const ARange: TDateTimeRange): TDuration; static;See the declaration contract and linked executable example.
RangesTouchclass function RangesTouch(const AFirst, ASecond: TDateTimeRange): Boolean; static;See the declaration contract and linked executable example.
RangeGapclass function RangeGap(const AFirst, ASecond: TDateTimeRange): TDuration; static;See the declaration contract and linked executable example.
SubtractRangeclass function SubtractRange(const AValue, ARemove: TDateTimeRange): TDateTimeRangeArray; static;See the declaration contract and linked executable example.
TryMergeRangesclass function TryMergeRanges(const AFirst, ASecond: TDateTimeRange; out AMerged: TDateTimeRange): Boolean; static;See the declaration contract and linked executable example.
TryIntersectRangesclass function TryIntersectRanges(const AFirst, ASecond: TDateTimeRange; out AIntersection: TDateTimeRange): Boolean; static;See the declaration contract and linked executable example.
DecimalYearToDateTimeclass 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.
DateTimeToDecimalYearclass function DateTimeToDecimalYear( const AValue: TDateTime): Double; static;Converts a date/time to a decimal year, including its time-of-day fraction.
GetISOYearclass function GetISOYear(const AValue: TDateTime): Integer; static;Returns the ISO year (week-based year) for a given TDateTime value.
GetISOWeekclass function GetISOWeek(const AValue: TDateTime): Integer; static;Returns the ISO week number (week of the year) for a given TDateTime value.
GetSemesterclass function GetSemester(const AValue: TDateTime): Integer; static;Returns the semester (1 or 2) for a given TDateTime value.
RoundDateclass function RoundDate(const AValue: TDateTime; const AUnit: TDateUnit): TDateTime; static;Rounds a TDateTime value to the nearest specified time unit.
GetSystemTimeZoneInfoclass function GetSystemTimeZoneInfo( const AValue: TDateTime): TTimeZoneInfo; static;See the declaration contract and linked executable example.
GetSystemTimeZoneclass function GetSystemTimeZone: string; static;Retrieves the system's current time zone as a string.
GetTimeZoneNamesclass function GetTimeZoneNames: TStringArray; static;Retrieves an array of all available time zone names.
IsValidTimeZoneNameclass function IsValidTimeZoneName(const ATimeZone: string): Boolean; static;Checks if a given string is a valid timezone name known to the system.
IsValidUTCOffsetclass function IsValidUTCOffset(const AOffset: Integer): Boolean; static;Checks if a given integer represents a valid UTC offset in minutes.
ValidateTimeZoneclass function ValidateTimeZone(const ATimeZone: string): string; static;Validates a timezone name, raising an exception if invalid.
ValidateTimeZoneOffsetclass function ValidateTimeZoneOffset(const AOffset: Integer): Integer; static;Validates a UTC offset in minutes, raising an exception if invalid.
SystemLocalToTimeZoneclass function SystemLocalToTimeZone(const AValue: TDateTime; const ATimeZone: string): TDateTime; static;See the declaration contract and linked executable example.
TimeZoneToSystemLocalclass function TimeZoneToSystemLocal(const AValue: TDateTime; const ATimeZone: string): TDateTime; static;See the declaration contract and linked executable example.
ConvertBetweenTimeZonesclass 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.