zoukankan      html  css  js  c++  java
  • delphi

    可变参数 SysUtils.Format

    Format(const S : String; const args : array of const);

    默认值

    Debug(const Msg : String; const Err : Exception = nil);

    控件的 Anchors 属性: 保持与父控件相应边界的距离固定

    日期时间

    unit uSpecializedDateTimeFormatter;
    
    { 关于 日期时间 与 字符串 转换的特化函数
      ---------
      为转换下列格式而写 :
        yyyy-MM-dd HH:mm:ss
        yyyy-MM-dd
        HH:mm:ss
    }
    interface
    
    
    type
      TSpecializedDTFmtter = class
        public
          class function Fmt(const AFmtString : String; const ADateTime : TDateTime) : String;
          class function Parse(const ADateTimeStr : String) : TDateTime;
      end;
    
    
    implementation
    
    uses
      SysUtils;
    
    
    var
      _FmtSettings : TFormatSettings;
    
    
    class function TSpecializedDTFmtter.Fmt(const AFmtString : String; const ADateTime : TDateTime) : String;
    begin
      Result := FormatDateTime(AFmtString, ADateTime, _FmtSettings);
    end;
    
    class function TSpecializedDTFmtter.Parse(const ADateTimeStr : String) : TDateTime;
    begin
      Result := StrToDateTime(ADateTimeStr, _FmtSettings);
    end;
    
    
    function GetFmtSettings() : TFormatSettings;
    begin
      GetLocaleFormatSettings(0, Result);
    
      Result.DateSeparator := '-';
      Result.TimeSeparator := ':';
    
      Result.ShortDateFormat := 'yyyy-MM-dd';
    
      Result.LongTimeFormat := 'HH:mm:ss';
    end;
    
    
    initialization
      _FmtSettings := GetFmtSettings();
    
    
    end.

    ---------  THE END  ---------

  • 相关阅读:
    Android学习地址
    Android动画设计源码地址
    chromeWebBrowser之浏览器开发
    win8.1蓝屏解决
    打包应用程序
    win8.1解决鼠标右键反应慢的问题
    Rewrite服务器和robots文件屏蔽动态页面
    第08组 Alpha事后诸葛亮
    第08组 Alpha冲刺(6/6)
    第08组 Alpha冲刺(5/6)
  • 原文地址:https://www.cnblogs.com/shadow-abyss/p/10968015.html
Copyright © 2011-2022 走看看