Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Messing With Date Fields?

Status
Not open for further replies.

SpeedDemon

Programmer
Jan 1, 2001
70
GB
Hi all, i have a TDateTime File which was generated using the 'now' function, the field is called saveddate.

i'd like todo the following if statement, however I have no idea how todo it...

if saveddate > 'Now' - 30 days do
begin
..
end;

Where the conditional it checking if the saveddate was before the current date minus 30 days... Please help

 
You can do exactly that. It's just
Code:
if saveddate < Now - 30 then
begin
   ..
end;
Note I changed > to <.
 
hehe, cheers, just figured the data stuffs out, i though data was stored in the same way as a unix system, in seconds since 1970, but its not, all working now :)

I was minusing 30 days in seconds.. no wonder it wasnt working! doh!! :p

Cheers mate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top