01-15-2007 06:05 AM
01-15-2007 07:01 AM
01-15-2007 07:09 AM
01-15-2007 07:10 AM - edited 01-15-2007 07:10 AM
Hi Rich_E,
When comparing times where the difference I'm looking for is shortish, I just build up the difference in seconds, (5 days = 5 * 24 * 60 * 60 seconds) and compare the appropriate date/time in seconds values.
I assume that you will have a U32 for the file's date/time.
Now get current date/time (also a U32)
Both times represent the number of seconds that have elspased since a time before PCs existed (atcually 00:00:00 GMT on 01 Jan 1904, but that doesn't matter for this test). The difference between the two values you have is the the age in seconds you're looking for.
You may also find the seconds to date/time and time/date to seconds vi's useful. The LabVIEW help on these explain their usage well. If you want to base your comparison on a perticular time of day rather that the exact number of seconds you might like to get the date/time, update particular values and convert back to a time in seconds. It will happily treat a setting of 35 January as being 04 February so you don't have to be too particular in what you set.
Rod.
Message Edited by Rod on 01-15-2007 01:21 PM
01-15-2007 07:52 AM
All,
Many thanks for your prompt responses! KenT's solution seems like the easiest and most straightforward for what I'm after though all the information posted is very interesting!
Many thanks, you've all helped save the day! 😉