comparedatetime函数怎么用?,请帮忙。
解决方案 »
- IdHttp获得源码、同一个网站为何有时是乱码、有时正常?
- fastreport 不对称型分栏
- 如何将TQuery查询出的数据保存到本地??十万火急啊!!!
- 怎样用IdTCPClient,IdTCPServer实现多人聊天,急!!!!
- 名片怎么翻译,正做数据库
- 如何解决连接网络硬盘可靠性的问题?(100分敬上)
- 一个oracle的小问题,解决了一定给分
- 想用Delphi做一个Activex,在网页上取得一个域的值显示到Activex的form的一个edit里面。有那位能帮我解决这个问题啊? 在线等待!
- 有谁知道什么地方可以免费上传软件供人试用?我有一个软件想发表!
- 怎样查找数据库表中的ftMemo型字段?
- 设计控件时怎样决定在组件面板上的图标?
- KV3000的文件夹浏览器,(文件夹前带方框)如何制作,是否有这样的控件?
function CompareDateTime(const A, B: TDateTime): TValueRelationship;
返回:
LessThanValue if A is earlier than B.
EqualsValue if A is the same as B.
GreaterThanValue if A is later than B.
在看TValueRelationship的定义
type TValueRelationship = -1..1;一个集合类型如果你写个例子,你会发现tdatetime类型一个很有趣的细节,我们知道一个tdatetime变量对应一个double值,在程序里,即时两个tdatetime变量取同样的year,month,day,hour...它们的double值还是不同的,(我想,应该是由于编译时取值时间不同的差别,虽然编译的速度很快)这些在帮助里也有叙述。
Note: CompareDateTime differs from a direct comparison of the corresponding Double values in that two TDateTime values are considered the same if they have the same value down to the millisecond. It is possible to create two TDateTime values that differ numerically when viewed as Doubles, but which represent the same year, month, day, hour, minute, second, and millisecond.