有问题请加入技术Q群: 36085817(DELPHI朋友)
 

时 间 记 忆
最 新 评 论
专 题 分 类
最 新 日 志
最 新 留 言
搜 索
用 户 登 录
友 情 连 接
博 客 信 息


 
DateTimePicker日期和字符串的转换例子
[ 2007-12-22 2:23:00 | By: roki ]
 
改变 DateTimePicker1的显示值:

 DateTimePicker1.Date:= StrToDatetime('1990-12-31 12:30:30');

 DateTimePicker1.Refresh;
-------------------
DateTimePicker1 的format 很重要 是显示的格式

如 yyyy-mm-dd hh:mm:ss就是一种显示格式
如 yyyy\mm\dd hh:mm:ss 也是一种显示格式
如 yyyy年mm月dd日 hh:mm:ss


 
formatdatetime('yyyy-mm-dd',DateTimePicker1.date)   //转换成String型
edit1.text:=datetostr(DateTimePicker1.date);
edit1.text:=Datetimetostr(DateTimePicker1.Time);
Edit1.text:=FormatDateTime('yyyy''年''mm''月''dd''日''',StrToDate(ADate));
 
有问题请 加入 技术Q群 :36085817(DELPHI朋友)
  • 标签:delphi 
  • 发表评论:

      大名:
      密码:
      主页:
      标题:
    Powered by Oblog.