delphi 日期字符串转换日期格式


本文整理自网络,侵删。

 
 function MyStrToDateTime(vStr: string): TDateTime;
  var
    S: string;
    v: Variant;
  begin
    Result := now;
    S := S := StringReplace(vStr, '.', '-', [rfReplaceAll]);
    S := StringReplace(S, '/', '-', [rfReplaceAll]);
    S := StringReplace(S, '\', '-', [rfReplaceAll]);
    S := StringReplace(S, ' ', '-', [rfReplaceAll]);
    S := StringReplace(S, '.', '-', [rfReplaceAll]);
    S := StringReplace(S, '/', '-', [rfReplaceAll]);
    S := StringReplace(S, '\', '-', [rfReplaceAll]);
    v := S;
    try
      Result := VarToDateTime(v);
    except
    end;
  end;

相关阅读 >>

Delphi istream与tstream之间的相互转换

Delphi webbrowser获取页面全部链接

Delphi数值转ip

Delphi 直接将html字符串读入webbrowser中

Delphi touchkeyboard1 基本用法

Delphi2010中使用pchar时e2010 incompatible types: 'char' and 'ansichar' 错误的处理

Delphi编写聊天程序

Delphi fdconnection查看所有表包含用户表和系统表

Delphi tidhttp 超时的解决方案

Delphi tstream 详细介绍

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...