Delphi的DateToStr StrToDate格式灵活用法
来源:互联网 发布:mac 一键关闭所有窗口 编辑:程序博客网 时间:2024/06/05 01:17
procedure TForm1.Button1Click(Sender: TObject);
var ADate: String; ADate2: TDate; AFormat, AFormat2: TFormatSettings;
begin
AFormat.ShortDateFormat := 'ee/mm/dd';
AFormat.DateSeparator := '/';
ADate := '94/05/15';
ADate2 := StrToDate( ADate, AFormat );
AFormat2.ShortDateFormat := 'yyyy/mm/dd';
AFormat2.DateSeparator := '/';
ShowMessage( DateToStr( StrToDate( ADate, AFormat ), AFormat2 ) );
end;
其中,最重要的就是TFormatSettings这个类. 可以设置AFormat.shortDateFormat:='yyyymmdd' DateToStr(ADate,Aformat)得到字符串就是类似20080409的字符了. 如果是'yymmdd'则为080409的字符
- Delphi的DateToStr StrToDate格式灵活用法
- dateToStr and strToDate
- Delphi中慎用StrToDate函数
- 极其无聊的 StrtoDate 失败
- 关于Delphi7中日期函数StrtoDate的正确用法 win7报错
- jQuery选择器的灵活用法
- NSDate,日期格式的灵活输出
- DELPHI指针灵活运用
- 堆(优先队列)的灵活用法
- 灵活的服务,IntentService用法及原理
- 比__autoload 更灵活的 spl_autoload_register 用法
- Delphi format的用法
- Delphi TStringList的用法
- Delphi ListView的用法
- Delphi format的用法
- Delphi format的用法
- Delphi format的用法
- Delphi format的用法
- Color Graphics Adapter
- 【转】 AyncTask 实战 模拟GridView 动态更新效果
- shell 逻辑操作
- vi 基本操作
- aaa
- Delphi的DateToStr StrToDate格式灵活用法
- 遭遇开机自检问题:If you want to install linux default partition RAID driver,please do not use OPROM creation oporation
- MFC 原理学习笔记
- 第五周
- 网页中的数据提交后,在数据库执行两次的解决办法
- 小linux 移植命令的功能 单独脚本
- 50 个适合Web设计开发的免费图标集
- MFC程序组织结构
- MFC 框架学习