RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.StartOfADay Function

Returns a TDateTime that represents 12:00:00:00 AM on a specified day.

Pascal
function StartOfADay(const AYear: Word; const AMonth: Word; const ADay: Word): TDateTime; overload;
function StartOfADay(const AYear: Word; const ADayOfYear: Word): TDateTime; overload;
C++
TDateTime StartOfADay(const Word AYear, const Word AMonth, const Word ADay);
TDateTime StartOfADay(const Word AYear, const Word ADayOfYear);

StartOfADay returns the first expressible moment (12:00:000 AM) of a specified day. 

The AYear parameter specifies the year of the desired day. 

The ADayOfYear parameter specifies the desired day as a day of the year, where 1 is January 1, 2 is January 2, 32 is February 1, and so on. 

The AMonth and ADay parameters specify the desired day as a month of the year and day of the month. AMonth can range from 1 to 12. ADay can range from 1 to 28, 29, 30, or 31, depending on the values of AYear and AMonth. 

If the parameters do not specify a valid date, StartOfADay raises throws an EConvertError exception. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!