还是日期格式问题在线等候 (100分)

H

hthugm

Unregistered / Unconfirmed
GUEST, unregistred user!
shortDateFormat:='yyyy-mm-dd';
dateseparator:='-'
Timeseparator:=':'
shortTimeFormat:='hh:mm:ss';
showmessage(dateTimeToStr(37526.333333))
结果为2002-09-27 [red]7[/red]:59:59
我想得到的结果为2002-09-27 [purple]07[/purple]:59:59
希望高手指教?不能从控制面板改.
 
我怎么看不到答案?
 
用formatdatetima函数来做啊
 
我的意思必须从showmessage(dateTimeToStr(37526.333333))
得到我想要的答案。
 
ShwoMessage(FormatDateTime('yyyy-mm-dd hh:mm:ss',37526.333333));
 
formatDataTime可以满足你的要求,不过rustle有一个地方写错了,格式应该是
yyyy-mm-dd hh:nn:ss
 
  
to hthugm:
 你用错变量了。在DateTimeToStr()函数里,日期取ShortDateFormat,时间取LongTimeFormat
 将你的“shortTimeFormat:='hh:mm:ss';”改成“ LongTimeFormat:='hh:mm:ss'”就行了。
  
 
顶部