DateUtils.TryEncodeDateTime
Contents |
Delphi Information
From DateUtils.pas
function TryEncodeDateTime(const AYear: Word; const AMonth: Word; const ADay: Word; const AHour: Word; const AMinute: Word; const ASecond: Word; const AMilliSecond: Word; out AValue: TDateTime): Boolean;
Unit: DateUtils
Type: function
Visibility: public
C++ Information
From DateUtils.hpp
bool __fastcall TryEncodeDateTime(unsigned short AYear, unsigned short AMonth, unsigned short ADay, unsigned short AHour, unsigned short AMinute, unsigned short ASecond, unsigned short AMilliSecond, System::TDateTime & AValue);
Unit: DateUtils
Type: function
Description
Calculates the TDateTime value that represents a specified year, month, day, hour, minute, second, and millisecond.
TryEncodeDateTime calculates the TDateTime value for the values specified as the AYear, AMonth, ADay, AHour, AMinute, ASecond, and AMilliSecond parameters.
The year must be from 1 through 9999.
Valid month values are from 1 through 12.
Valid day values are from 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 from 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 from 0 through 59.
Valid second values are from 0 through 59.
Valid millisecond values are from 0 through 999.
AValue returns the specified date and time as a TDateTime value.
TryEncodeDateDay returns True if the parameters are all within range, and False otherwise.
See Also
Code Samples