zoukankan      html  css  js  c++  java
  • delphi中日期类型TDateTime使用总结

    刚才真正明白了Delphi中的TDateTime类型,实际上为一个浮点数,因此TDateTime类型的两个变量可以进行浮点数的大部分操作,对于小数部分可以使用minuteof输出它的分钟数,负小数取补后转化为分钟数。并且可以通过TDateTimeToStr,StrToDateTime可以方便与string类型转换,通过FormatDateTime方便的输出想要格式的日期,如:FormatDateTime('yyyy-mm-dd', OriTime);

     if (IsTimeOut or (PatTime - LastTime >= 1) or ((PatTime > LastTime) and (Minuteof(PatTime - LastTime ) >= 40))) then       begin

    end ;
     另外Delphi中的记录型要放在链表中必须使用指针(其它语言也都是链表中放指针)例子如下:

      for i := 0 to TriggerList.Count - 1 do
      begin
        PPatrol:= GetMemory(sizeof(TPatrolTime));
        Trigger := TriggerList.Item[i];
        if (Trigger <> nil) and (Trigger.TriggerKind = 'H') then
        begin
          PPatrol.Trigger:=Trigger;
          PPatrol.LastTime:= Now;
          PPatrol.IsTimeOut:= False;
          FList.Add(PPatrol);
        end;
      end;
    好的代码像粥一样,都是用时间熬出来的
  • 相关阅读:
    DirectoryInfo
    TextBox Validation
    ICollectionView
    MEF
    LocBaml
    加快wpf程序 启动速度
    jQuery获取Radio元素的值 深蓝
    如何创建一个规范的zen cart 模板 深蓝
    打通网络营销的任督二脉 深蓝
    jQuery选择没有colspan属性的td 深蓝
  • 原文地址:https://www.cnblogs.com/jijm123/p/13659697.html
Copyright © 2011-2022 走看看