SysUtils Function Description
DateTimeToTimeStamp
(System::TDateTime DateTime)
Returns the TDateTime object that is passed as a
parameter to this function as an instance of the VCL
TTimeStamp structure type. TTimeStamp stores individual
date and time values as integers. The date value represents
the number of days that have passed since the date
01/01/0001, and the time value represents the number of
seconds elapsed since midnight. This structure is intended
to give another form of representation to the current
timestamp value.
DateToStr (System::TDateTime
Date)
Returns the date portion of the TDateTime object that is
passed as a parameter to this function as a formatted
AnsiString object. The format is specified by the
ShortDateFormat global variable, which is obtained from
the operating system Control Panel à Regional Settings à
Date tab page.
DayOfWeek (System::TDateTime
Date)
Returns the day of the week for the TDateTime object
that is passed as a parameter to this function as an integer
value; 1 represents Sunday and 7 represents Saturday.
DecodeDate (System::TDateTime
Date, Word &Year, Word &Month,
Word &Day)
Converts the date portion of the TDateTime object that is
passed as a parameter to this function to individual day,
month, and year components.
DecodeTime(System::TDateTime
Time, Word &Hour, Word &Min,
Word &Sec, Word &MSec)
Converts the time portion of the TDateTime object that is
passed as a parameter to this function to individual hour,
minute, second, and millisecond components.
EncodeDate (Word Year, Word
Month, Word Day)
Returns a TDateTime object containing a date value that is
constructed from the individual components of day,
month, and year. The year must be between 1 and 9999.
The month must be between 1 and 12. The day must be
between 1 and 31 based on the month specified. If the
specified values do not yield a valid date, an EConvertError
exception is thrown.
EncodeTime (Word Hour, Word
Min, Word Sec, Word MSec)
Returns a TDateTime object containing a time value that is
constructed from the individual components of hour,
minute, second, and millisecond. Valid Hour values are 0
through 23. Valid Min and Sec values are 0 through 59.
Valid MSec values are 0 through 999. The resulting object
contains the decimal fraction value that conforms to the
TDateTime object’s time value rules. If the specified values
are not within range, an EConvertError exception is
thrown.
Advanced VCL Features
n
97
6
Chapter