RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DateUtils.EncodeDateTime Function

Returns a TDateTime that represents a specified year, month, day, hour, minute, second, and millisecond.

Pascal
function EncodeDateTime(const AYear: Word; const AMonth: Word; const ADay: Word; const AHour: Word; const AMinute: Word; const ASecond: Word; const AMilliSecond: Word): TDateTime;
C++
TDateTime EncodeDateTime(const Word AYear, const Word AMonth, const Word ADay, const Word AHour, const Word AMinute, const Word ASecond, const Word AMilliSecond);

DateUtils

EncodeDateTime returns a TDateTime from the values specified as the AYear, AMonth, ADay, AHour, AMinute, ASecond, and AMilliSecond parameters. 

The year must be between 1 and 9999. 

Valid month values are 1 through 12. 

Valid day values are 1 through 28, 29, 30, or 31, depending on the month value. For example, the possible day values for month 2 (February) are 1 through 28 or 1 through 29, depending on whether or not the year value specifies a leap year. 

Valid hour values are 0 through 24. (If the specified hour is 24, the minute, second, and millisecond values should all be 0, and the resulting TDateTime value represents midnight at the end of the specified day and the beginning of the next day). 

Valid minute values are 0 through 59. 

Valid second values are 0 through 59. 

Valid millisecond values are 0 through 999. 

If the specified values are not within range, EncodeDateTime raises an EConvertError exception. 

 

EncodeTime 

EncodeDate 

YearOf 

MonthOf 

DayOf 

HourOf 

MinuteOf 

SecondOf 

MillisecondOf 

EConvertError 

EncodeDateDay 

EncodeDateWeek 

TryEncodeDateTime

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!