字段类型为datetime,
格式为11:02:03我想算出该时间的用秒计算的数值,
如果转化成string类型,
tottime:= strtofloat(copy(pdatetime,1,2))*3600+strtofloat(copy(pdatetime,4,2))*60+strtofloat(copy(pdatetime,7,2));使用上述语句,却报错,
我分析原因是如果格式为00:00:01的话,
取到的值就有问题,有没有ASP中的hour()类似的涵数?在线等待!
格式为11:02:03我想算出该时间的用秒计算的数值,
如果转化成string类型,
tottime:= strtofloat(copy(pdatetime,1,2))*3600+strtofloat(copy(pdatetime,4,2))*60+strtofloat(copy(pdatetime,7,2));使用上述语句,却报错,
我分析原因是如果格式为00:00:01的话,
取到的值就有问题,有没有ASP中的hour()类似的涵数?在线等待!
解决方案 »
- 数据转换的问题
- 关于Access中“同步复制ID”类型的问题???
- 放分拉!这样的sql语句怎么解决???
- 我想问一下,是在DELPHI中程序设计中,怎么样进行数据库记录的统计和显示当前记录号
- 求爷爷告奶奶,谁能告诉我怎么样画出 EXCEL 横格的框线宽度!!!!!!!!!!!!
- 终于完成了一个小软件,可是没处发表
- 使用‘copyfile(('d:\pxglxt\dbf\pxry.db'),('d:\pxglxt\databak\pxry.db'),false);’语句时出现的错误?
- (真正高手请进)高分求得利用DLL数据传送的资料(一定给分)
- 能吗??????
- 怎么让按钮(TButton)截获WM_LBUTTONDBLCLK消息并处理它呢?
- 大侠们,我刚学DELPHI,能否帮我介绍ADO 里那几个控件的用途和关系?
- 一个简单问题,怎样得到两个指定字符之间的字符!!
Returns the number of seconds between two specified TDateTime values.UnitDateUtilsCategorydatetime routinesDelphi syntax:function SecondsBetween(const ANow, AThen: TDateTime): Int64;C++ syntax:extern PACKAGE __int64 __fastcall SecondsBetween(const System::TDateTime ANow, const System::TDateTime AThen);DescriptionCall SecondsBetween to obtain the difference, in seconds, between two TDateTime values. SecondsBetween counts only entire seconds. Thus, SecondsBetween reports the difference between 9:00:00 AM and 9:00:00:999 AM as 0 because the difference is one millisecond short of an entire second.
procedure TForm1.Button1Click(Sender: TObject);
var
t:Tdatetime;
begin
t:=strtotime('11:01:01');
showmessage(inttostr(secondsbetween(t,0)));
end;