GetFirstDayOfMonth Routines |
Unit
QESBPCSDateTime
Overloaded Variants |
Function GetFirstDayOfMonth(const DT: TDateTime): TDateTime; |
Function GetFirstDayOfMonth(const Month, Year: Word): TDateTime; |
Function GetFirstDayOfMonth(const Month, Year: Integer): TDateTime; |
Declaration
Function GetFirstDayOfMonth(const DT: TDateTime): TDateTime;
Description
Alternatively for a given Month Year.
Parameters |
DT | Date/Time to process. |
Month | Month in given year, 1 = Jan, 12 = Dec. |
Year | 4-digit Year, such as 1999. |
Category
Date/Time Arithmetic Routines
Month Based Arithmetic RoutinesImplementation
function GetFirstDayofMonth (const DT: TDateTime): TDateTime; var D, M, Y: Integer; begin OptDecodeDateI (DT, Y, M, D); Result := OptEncodeDateI (Y, M, 1) + Frac (DT); End; |
Declaration
Function GetFirstDayOfMonth(const Month, Year: Word): TDateTime;Implementation
function GetFirstDayofMonth (const Month, Year: Word): TDateTime; begin Result := OptEncodeDateW (Year, Month, 1); End; |
Declaration
Function GetFirstDayOfMonth(const Month, Year: Integer): TDateTime;Implementation
function GetFirstDayofMonth (const Month, Year: Integer): TDateTime; begin Result := OptEncodeDateI (Year, Month, 1); End; |
|