Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi date comparison

Tags:

date

delphi

What is the difference between the two functions "IsSameDay" and "SameDate" in the Delphi DateUtils library?

like image 640
Neville Cook Avatar asked Aug 28 '26 12:08

Neville Cook


1 Answers

The start of the day before day zero is TDateTime(-1.0). Noon of that day is TDateTime(-1.5).

IsSameDay(-1.5, -1); // False
SameDate(-1.5, -1); // True

For positive dates, the functions are equivalent.

like image 107
Rob Kennedy Avatar answered Aug 30 '26 09:08

Rob Kennedy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!