Вниз
Скачать: CL | DM;

Как получить только время из переменной типа TDatetime?   Найти похожие ветки 

← →
Status   (2004-03-12 10:40) [0]

Есть переменная типа TDatetime, в которой хранятся дата и время, как мне из неё получить только время?


← →
Ega23 ©   (2004-03-12 10:53) [1]

var
dt:TdateTime;

dt:=dt-Trunc(dt); // Теперь в dt только время


← →
Курдль ©   (2004-03-12 11:23) [2]

TimeOf

Strips the date portion from a TDateTime value.

Unit

DateUtils

Category

date/time routines

function TimeOf(const AValue: TDateTime): TDateTime;

Description

Call TimeOf to convert a TDateTime value to a TDateTime value that includes only the time information (sets the date portion to 0, which means 12/30/1899).


← →
Anatoly Podgoretsky ©   (2004-03-12 11:30) [3]

Ты Ega23 ©   (12.03.04 10:53) [1] не слушай, он тебе подсказал как уничтожить время, а для уничтожения даты надо использовать Frac


← →
Ega23 ©   (2004-03-12 11:39) [4]

Ты Ega23 ©   (12.03.04 10:53) [1] не слушай, он тебе подсказал как уничтожить время, а для уничтожения даты надо использовать Frac

Наоборот  :o)


← →
Guest ©   (2004-03-12 11:55) [5]

Не знаю понадобиться или нет, но может кому-нибудь пригодиться...
procedure GetCurTime;
var
 DateTime:TSystemTime;
 Time    :    String;
begin
GetLocalTime(DateTime);
Time:= inttostr(DateTime.wYear)+"."
      +inttostr(DateTime.wMonth)+"."
      +inttostr(DateTime.wHour)+"."
      +inttostr(DateTime.wMinute)+"."
      +inttostr(DateTime.wSecond)+"."
      +inttostr(DateTime.wMilliseconds);      
end;


← →
ЫЗШКШЕ   (2004-03-12 12:09) [6]

StrToDate(DateToStr(Now))


← →
ЫЗШКШЕ   (2004-03-12 12:15) [7]

тьфу ты время же



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.021 c
3-1078470164
bushmen
2004-03-05 10:02
2004.04.04
ADOStoredProc


4-1075176461
Drunya
2004-01-27 07:07
2004.04.04
Как поймать заголовки окон


1-1079612780
sav
2004-03-18 15:26
2004.04.04
TreeView


11-1059319517
BelchonokH
2003-07-27 19:25
2004.04.04
pstream.free


3-1076922582
чайник1
2004-02-16 12:09
2004.04.04
Как переиндексировать таблицы




   Наверх