Delphi的字符串日期互转方法(DateToStr/StrToDate)

Delphi下时间和字符串互转用使用DateToStr或者StrToDate函数。
这两个函数没有php下的date函数方便和灵活。不过有时候也确实需要用到。

我写的下面这几句代码基本上体现了DateToStr比较完整的用法

  aFormat.ShortDateFormat := ‘yyyy/mm/dd hh:mm:ss’;
  aFormat.DateSeparator := ‘/’;
  ShowMessage( DateToStr( now, aFormat) );

Posted in 开发手记 at 08月 10th, 2009. Trackback URI: trackback
Tags: , ,

One Response to “Delphi的字符串日期互转方法(DateToStr/StrToDate)”

  1. 10月 14th, 2009 at 15:39 #nfl jerseys

    学习了!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
请输入图片中的字符以验证你并非垃圾机器人. 点击图片收听验证码的语音版.
点击这里收听此验证码的语音版本