Форум — Ответы     (  К темам )
 ?  Dr.Phoenix: Как работать с типом TDateTime? (20-04-2003 17:31:01)
Хочу сделать чтоб определеныые действия выполнялись по времени. Нашел компонент DateTimePicker, а в нем время в вормате TDateTime. В хелпе написанно как там дата записывается, а про запись времени, вроде, ничего нету. Так вот вопрос: Какая там форма записи, и как проще всего вытащить время в нормальную форму?
 Георгий (20-04-2003 18:52:16)
TDateTime — хранит число дней относительно 12/30/1899 12:00 am
а физически — это число типа float (32bit)
Description

TDateTime implements the Object Pascal TDateTime data type and the Delphi date/time runtime library routines that use the TDateTime data type.

The TDateTime class inherits a val data member declared as a double that holds the date-time value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

Following are some examples of TDateTime values and their corresponding dates and times:

0 12/30/1899 12:00 am
2.75 1/1/1900 6:00 pm
-1.25 12/29/1899 6:00 am
35065 1/1/1996 12:00 am

To find the fractional number of days between two dates, subtract the two values. To increment a date and time value by a certain fractional number of days, add the fractional number to the date and time value.

TimeString()
DateTimeString()
DateString()