Delphi中如何用格式化对时间和日期进行限定?
我原来是用CB的,
CB里面有一个Date->FormatString("")
或Time->FormatString("");对日期或时间进行格式化,
请问Delphi中如何进行操作????
我原来是用CB的,
CB里面有一个Date->FormatString("")
或Time->FormatString("");对日期或时间进行格式化,
请问Delphi中如何进行操作????
FormatDateTime('yyyy')
FormatDateTime('mm')
FormatDateTime('yyyy-mm-dd' ,now)
FormatDateTime('yyyy',now)
FormatDateTime('mm',now)
:= StrToDateTime(FormatDateTime('yyyy-m-d', DTP_Time.Date));
FormatDateTime('yyyy-mm-dd',Date)
FormatDateTime('yyyy',Date)
FormatDateTime('mm',date)
但还可以对他进行转换
如:
我可以将他转化为整型或字符串
DateToStr(FormatDateTime('mm',date))
DateToInt(FormatDateTime('mm',date))
其他类似。