delphi中FormatDateTime和DateTimeToStr区别

startime := FormatDateTime('yyyy-mm-dd HH:MM:ss',dtpStart_time.DateTime);
可用于数据库查询,结果类似“2012-8-24 10:00:00”,结果很纯粹,可控时期格式。
endtime := DateTimeToStr(dtpEnd_time.DateTime);
可用于界面显示,结果类似“2012-8-24 上午 10:00:00”,勿用于数据库查询,DateTimeToStr在xp系统下有“上午”,“下午”这种词,win7下无此问题。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29753604/viewspace-1257447/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29753604/viewspace-1257447/

你可能感兴趣的:(delphi中FormatDateTime和DateTimeToStr区别)