又是一个菜鸟级的问题,有劳各位了(50分)

  • 主题发起人 mylovegirl
  • 开始时间
M

mylovegirl

Unregistered / Unconfirmed
GUEST, unregistred user!
怎么才能把系统的时间和日期分开
就是时,分,秒,年,月,日 各个分离
有劳有劳
 
showmessage(FormatDateTime('yyyy',now));//年
showmessage(FormatDateTime('mm',now)); //月
showmessage(FormatDateTime('dd',now)); //日
showmessage(FormatDateTime('hh',now)); //时
showmessage(FormatDateTime('nn',now)); //分
showmessage(FormatDateTime('nn',now)); //秒
showmessage(FormatDateTime('zzz',now)); //毫秒
 
这样一来好简单,试试再给分了
 
还有两钟方法

1.decodeData(year,mon,day);

2.uses DateUtils;
然后可以用 yearOf(); MonthOf(); dayOf();
 
DecodeDateTime
 
还有星期怎么办呢,我实在很菜
 
uses DateUtils;
DecodeDateWeek
 
我来晚了,用
1.decodeData(year,mon,day);

2.uses DateUtils;
然后可以用 yearOf(); MonthOf(); dayOf();
不错。我都用过。
 
function DayOfWeek(Date: TDateTime): Integer;
 
label.Caption := DateToStr(Date)+‘ ’+TimeToStr(Time)
 
多人接受答案了。
 

Similar threads

回复
0
查看
886
不得闲
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
975
SUNSTONE的Delphi笔记
S
顶部