设置字段显示格式的方法
来源:互联网 发布:nodejs运行js文件 编辑:程序博客网 时间:2024/06/11 13:54
((TDateField *)(ADOQuery1->Fields->Fields[0]))->DisplayFormat="yyyymmdd";
格式字符串(来自CB的HELP)
Controls the formatting of the date-time field for display purposes.
__property AnsiString DisplayFormat = {read=FDisplayFormat, write=SetDisplayFormat};
Description
Use DisplayFormat to specify the formatting string to use for formatting the value in a date-time field when the field抯 value appears as a string. If DisplayFormat is not assigned a string, the value is formatted according to the default date-time format.
Note: DisplayFormat does not affect the value of the AsString property.
Construct a DisplayFormat string using these format specifiers:
Specifier Displays
c The date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.
d The day as a number without a leading zero (1-31).
dd The day as a number with a leading zero (01-31).
ddd The day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.
dddd The day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.
ddddd The date using the format given by the ShortDateFormat global variable.
dddddd The date using the format given by the LongDateFormat global variable.
m The month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mm The month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mmm The month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.
mmmm The month as a full name (January-December) using the strings given by the LongMonthNames global variable.
yy The year as a two-digit number (00-99).
yyyy The year as a four-digit number (0000-9999).
h The hour without a leading zero (0-23).
hh The hour with a leading zero (00-23).
n The minute without a leading zero (0-59).
nn The minute with a leading zero (00-59).
s The second without a leading zero (0-59).
ss The second with a leading zero (00-59).
t The time using the format given by the ShortTimeFormat global variable.
tt The time using the format given by the LongTimeFormat global variable.
am/pm The time using the 12-hour clock for the preceding h or hh specifier, followed by "am" for any hour before noon, or "pm" for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
a/p The time using the 12-hour clock for the preceding h or hh specifier, followed by "a" for any hour before noon, or "p" for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
ampm The time using the 12-hour clock for the preceding h or hh specifier, followed by the contents of the TimeAMString global variable for any hour before noon, or the contents of the TimePMString global variable for any hour after noon.
/ The date separator character given by the DateSeparator global variable.
: The time separator character given by the TimeSeparator global variable.
'xx'/"xx" Characters enclosed in single or double quotes are displayed as-is, with no formatting changes.
Format specifiers may be written in uppercase or lowercase letters; both produce the same result.
If the string given by the Format parameter is empty, the date and time value is formatted as if a c format specifier had been given.
- 设置字段显示格式的方法
- Gridview中设置绑定字段的显示格式
- 设置金额字段的格式
- GridView 显示设置的字段
- gridview中设置绑定的日期时间类型字段的显示格式
- 在Gridview中设置日期字段的显示格式为yyyy-MM-dd
- zeoslib:怎样定义字段的显示格式
- Oracle 字段格式显示
- sql中设置字段的显示个数
- Eclipse设置选中方法名 或者 字节 ,文章中所有的相同字段 高亮显示
- flex 自定义LineChart的数据字段的显示格式 dataFunction
- Smartforms字段显示格式控制
- winform设置datatimepicker显示的时间格式
- gridcontrol日期行的显示格式设置
- 设置dagagridView某列的显示格式
- GridControl中列的显示格式设置
- PLSQL 设置 里面timestamp显示的格式
- Matlab与线性代数 -- 显示格式的设置
- 正则表达式在网页处理中的应用四则
- Math For Programmers
- 原来要初始化VGA
- 重新C++
- 工厂模式不很适合C++
- 设置字段显示格式的方法
- Delphi实现WINDOWS“本地连接”的启用和禁用
- 禁用启用网卡
- MENU怎么用啊
- 越来越......
- 微软的一个BUG
- 2006年F1第二站马来西亚雪邦
- 工作和生活。
- 初恋心情——两年前的文章,都快找不到了