Delphi中StrToDateTime函数TFormatSettings参数的使用
来源:互联网 发布:积家约会 知乎 编辑:程序博客网 时间:2024/05/22 01:33
var FSetting : TFormatSettings; DateTime1: tDateTime;begin FSetting := TFormatSettings.Create(LOCALE_USER_DEFAULT); FSetting.ShortDateFormat:='yyyy-MM-dd'; FSetting.DateSeparator:='-'; //FSetting.TimeSeparator:=':'; FSetting.LongTimeFormat:='hh:mm:ss.zzz'; DateTime1 := StrToDateTime('2011-10-20 15:59:59:789', FSetting);end;
上例中的代码经过测试,加入FSetting.TimeSeparator:=':';后,毫秒部分读取失败,原因不太清楚。
TFormatSettings中一些属性的解释:
DateSeparator :Char
日期分隔符,用于分隔年月日TimeSeparator :Char
时间分隔符,用于分隔小时,分钟,秒
ShortDateFormat:String
区域设置中短日期格式的定义。
LongDateFormat :String
区域设置中长日期格式的定义。
ShortTimeFormat:String
区域设置中短时间格式的定义。
LongTimeFormat :String
区域设置中长时间格式的定义。
TimeAMString :String
用来表示上午的字符串
TimePMString :String
用来表示下午的字符串
ShortMonthNames:array[1..12] of String;
用于缩略表示月份名称的数组,就是在使用FormatDateTime时显示的mmm标识的字符串
LongMonthNames:array[1..12] of String;
用于完整表示月份名称的数组,就是在使用FormatDateTime时显示的mmmm标识的字符串
ShortDayNames :array[1..7] of String;
用于缩略表示星期名称的数组,就是在使用FormatDateTime时显示的ddd标识的字符串
LongDayNames :array[1..7] of String;
用于完整表示星期名称的数组,就是在使用FormatDateTime时显示的ddd标识的字符串
TwoDigitYearCenturyWindow:Word = 50;
在使用两位年份时的起始年份。
- Delphi中StrToDateTime函数TFormatSettings参数的使用
- Delphi中StrToDateTime函数TFormatSettings参数的使用
- Delphi中StrToDateTime函数TFormatSettings参数的使用
- Delphi使用StrToDatetime在不同操作系统出现不同的情况
- Delphi使用StrToDatetime在不同操作系统出现不同的情况
- StrToDateTime的使用
- Delphi 有关日期时间的函数,以及StrToDateTime函数在不同系统出现错误的解决方案
- delphi —StrToDateTime函数在不同系统出现错误的解决方案
- delphi中使用多线程及函数调用多参数
- Delphi中分隔字符串函数的使用
- Delphi中函数指针的使用
- delphi中函数指针的使用
- Delphi中GetTickCount函数的使用
- delphi StrToDateTime在win7或者控制面板中改过短日期格式出错
- delphi seek函数中参数说明
- delphi seek函数中参数说明
- 在Delphi中使用指针参数
- Delphi中图像混合透明的函数AlphaBlend的使用
- unable to find a medium containing a live file system
- Java2十大经典中文图书
- mysql重建索引
- 汉诺塔问题
- maven eclipse miss required library解决
- Delphi中StrToDateTime函数TFormatSettings参数的使用
- [iPhone开发项目] 团购信息
- 百度地图查询周围建筑
- C++ 强制类型转换
- 继承学习2
- [C#] 复制文件并计算传输速度
- ubuntu cd安装的一个问题
- CSS圆角效果 -webkit-border-radius(CSS3中border-radius隐藏的威力)
- 使用Apache commons-codec Base64实现加解密