请问一下如何从Tdatetime中得到分钟数和小时数?? 如题. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 showmessage(Timetostr(datetimePicker1.time)) formatdatetime('hh:mm',datetimePicker1.time) function GetHour(Time: TTime): Integer;var h, m, s, ms: WORD;begin DecodeTime(Time, h, m, s, ms); Result := h;end;function GetMinute(Time: TTime): Integer;var h, m, s, ms: WORD;begin DecodeTime(Time, h, m, s, ms); Result := m;end; uses DateUtils;function HourOfTheDay(const AValue: TDateTime): Word; {取小时数}function MinuteOfTheHour(const AValue: TDateTime): Word; {取分钟数} FormatDateTime('yyyy-mm-dd',SFindDateTime.Date); //取日期formatdatetime('hh:mm',SFindDateTime.time);//取时间 请问一下如何从Tdatetime中得到分钟数和小时数?? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`showmessage(formatdatetime('hh:nn',now)); 修改EDIT中的数据再提交问题! 问一个SQL语句 如何判断一个字符是不是汉字? wwdbgrid的系列问题解决之道 sql语句求助! 请问如何得到cxGrid1DBTableView1.Columns[0]的FieldName?===========cxGrid1DBTableView1.Columns[0].DataBinding....... 李维的例子,显示blob内容 运行出错 edit输入问题。(在线等) 怎样才能修改英文控件中的英文,详见内容 fasterport 怎么截取字符 两个ADO的简单问题 INDY中mime的编码问题?
var
h, m, s, ms: WORD;
begin
DecodeTime(Time, h, m, s, ms);
Result := h;
end;function GetMinute(Time: TTime): Integer;
var
h, m, s, ms: WORD;
begin
DecodeTime(Time, h, m, s, ms);
Result := m;
end;
function MinuteOfTheHour(const AValue: TDateTime): Word; {取分钟数}
formatdatetime('hh:mm',SFindDateTime.time);//取时间
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
showmessage(formatdatetime('hh:nn',now));