LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check if file is older than a time period

Solved!
Go to solution

I want to check if a file is older than a time period like 1 or 2 days then perform an action on this result?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 1 of 4
(2,519 Views)
Solution
Accepted by topic author PauldePaor

Hey,

 

Quick and dirty see attached file.

 

Regards,

CMW

Message 2 of 4
(2,510 Views)

Yup this is how you do it.  The only change I would make is if you are going to have a constant on your block diagram of 2 days, right click the constant, go to properties, the Display Format tab, then choose Relative time.  This changes the look of the control but not the value.  This way 2 days can be represented with 48 hours which is a little easier to understand then 172800 seconds.  You can do this on controls too by the way.

Message 3 of 4
(2,490 Views)

Oh and keep in mind that this is if the file has been modified in the last 2 days.  If you want to know the file creation date, or the last date that the file was accessed you'll need some other Windows DLL calls.  I believe there is also a OpenG function under File I/O that does this.

0 Kudos
Message 4 of 4
(2,488 Views)