Unit sDate

Classes

TsDate -

Functions

DaysPerMonth -
DefDateFormat -
DefDateMask -
ExtractDay - Utils
ExtractMonth -
ExtractYear -
GetDateOrder -
IncDate - leap-year Feb is special
IncDay -
IncMonth -
IncYear -
IsLeapYear -
StrToDateDef -
StrToDateFmt -
StrToDateFmtDef -

Types

TDateArrayType
TDateOrder

Constants

FourDigitYear

Variables


Functions


function DaysPerMonth(AYear, AMonth: Integer): Integer;


function DefDateFormat: string;


function DefDateMask(BlanksChar: Char): string;


function ExtractDay(ADate: TDateTime): Word;

Utils

function ExtractMonth(ADate: TDateTime): Word;


function ExtractYear(ADate: TDateTime): Word;


function GetDateOrder(const DateFormat: string): TDateOrder;


function IncDate(ADate: TDateTime; Days, Months, Years: Integer): TDateTime;

leap-year Feb is special

function IncDay(ADate: TDateTime; Delta: Integer): TDateTime;


function IncMonth(ADate: TDateTime; Delta: Integer): TDateTime;


function IncYear(ADate: TDateTime; Delta: Integer): TDateTime;


function IsLeapYear(AYear: Integer): Boolean;


function StrToDateDef(const S: string; Default: TDateTime): TDateTime;


function StrToDateFmt(const DateFormat, S: string): TDateTime;


function StrToDateFmtDef(const DateFormat, S: string; Default: TDateTime): TDateTime;


Types


TDateArrayType =  array[1..42] of string[2];
Declares TsDate class - general date handling class, used in TsDateEdit and TsCalndar. The rest of the functions here just copied from RX's dateUtils unit - sometime for compatibility with other RX units, sometime I realy use them. Here is a hell of a job has to be done for optimizing of code. (a lot of stay along RX's functions and TsDate's members have the same functionality). If someone really care - go ahead and please send me a copy. Dimitry Statilko, dstatilko@hotmail.com
TDateOrder = (doMDY, doDMY, doYMD);

Constants

FourDigitYear = True

affects DefDateFormat and DefDateMask

Variables