'How to get yesterday date in Delphi

I know you can get the current date and time using the Now() function, but how would you get the date of yesterday?



Solution 1:[1]

Why not just use Date - 1 ?

Since one day is 1.0 in TDateTime encoding, substracting 1 is enough.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arnaud Bouchez