DateUtils.TryRecodeDateTime

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From DateUtils.pas

	function TryRecodeDateTime(const AValue: TDateTime;
		const AYear: Word;
		const AMonth: Word;
		const ADay: Word;
		const AHour: Word;
		const AMinute: Word;
		const ASecond: Word;
		const AMilliSecond: Word;
		out AResult: TDateTime): Boolean;


Unit: DateUtils

Type: function

Visibility: public

C++ Information

From DateUtils.hpp

	bool __fastcall TryRecodeDateTime(System::TDateTime AValue,
		unsigned short AYear,
		unsigned short AMonth,
		unsigned short ADay,
		unsigned short AHour,
		unsigned short AMinute,
		unsigned short ASecond,
		unsigned short AMilliSecond,
		System::TDateTime & AResult);


Unit: DateUtils

Type: function

Description

Selectively replaces parts of a specified TDateTime value.


Call TryRecodeDateTime to convert the date/time value specified by AValue with the value obtained by changing the year to AYear, the month to AMonth, the day of the month to ADay, the hour to AHour, the minute to AMinute, the second to ASecond, and the millisecond to AMilliSecond. Any one of these parameters can be set to RecodeLeaveFieldAsIs, which tells TryRecodeDateTime not to change the existing portion of the TDateTime value.

AYear can range from 1 through 9999 (or be RecodeLeaveFieldAsIs).

AMonth can range from 1 through 12 (or be RecodeLeaveFieldAsIs).

Legal values for ADay depend on the month represented by AMonth. (For example, if AMonth is 1, ADay can range from 1 to 31, if AMonth is 2, ADay can range from 1 to 28 or 1 to 29, depending on the year, and so on.) ADay can also be RecodeLeaveFieldAsIs.

AHour can range from 0 through 23 (or be RecodeLeaveFieldAsIs).

AMinute can range from 0 through 59 (or be RecodeLeaveFieldAsIs).

ASecond can range from 0 through 59 (or be RecodeLeaveFieldAsIs).

AMilliSecond can range from 0 through 999 (or be RecodeLeaveFieldAsIs).

AResult returns the results of making the specified changes to AValue.

TryRecodeDateTime returns True if the parameters are all in the valid range, False otherwise.

See Also

Code Samples


Personal tools
Translations
Newest Version