2011年10月19日 星期三

TO_CHAR 的毫秒

TO_CHAR 的毫秒要用 CURRENT_TIMESTAMP 配合 'SSXFF', 例:
TO_CHAR(CURRENT_TIMESTAMP,'YYYY/MM/DD HH24:MI:SSXFF');

2011年10月7日 星期五

Delphi 關於時間的 Format 設定

參考自:http://www.delphibasics.co.uk/RTL.asp?Name=DateTimeToString

y = Year last 2 digits
yy = Year last 2 digits
yyyy = Year as 4 digits
m = Month number no-leading 0
mm = Month number as 2 digits
mmm = Month using ShortDayNames (Jan)
mmmm = Month using LongDayNames (January)
d = Day number no-leading 0
dd = Day number as 2 digits
ddd = Day using ShortDayNames (Sun)
dddd = Day using LongDayNames (Sunday)
ddddd = Day in ShortDateFormat
dddddd = Day in LongDateFormat

c = Use ShortDateFormat + LongTimeFormat
h = Hour number no-leading 0
hh = Hour number as 2 digits
n = Minute number no-leading 0
nn = Minute number as 2 digits
s = Second number no-leading 0
ss = Second number as 2 digits
z = Milli-sec number no-leading 0s
zzz = Milli-sec number as 3 digits
t = Use ShortTimeFormat
tt = Use LongTimeFormat

am/pm = Use after h : gives 12 hours + am/pm
a/p = Use after h : gives 12 hours + a/p
ampm = As a/p but TimeAMString,TimePMString
/ = Substituted by DateSeparator value
: = Substituted by TimeSeparator value


In addition to this formatting, various of the above options are affected by the following variables, withe their default values :

DateSeparator = /
TimeSeparator = :
ShortDateFormat = dd/mm/yyyy
LongDateFormat = dd mmm yyyy
TimeAMString = AM
TimePMString = PM
ShortTimeFormat = hh:mm
LongTimeFormat = hh:mm:ss
ShortMonthNames = Jan Feb ...
LongMonthNames = January, February ...
ShortDayNames = Sun, Mon ...
LongDayNames = Sunday, Monday ...
TwoDigitCenturyWindow = 50