cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Aaron_Barnett
Level 5

Compare Dates

Hi,
I have this Function to get a File date

if (GetFileInfo (TARGETDIR + "\\abc.exe", FILE_DATE, nResult, sResult) = 0)
then
MessageBox ("File Date: " + sResult, SEVERE);
endif;

Is there a way to compare the the date sResult (YYYY-MM-DD) with a date object i create? ...

I want to be able to find out if the Date Modified date is greater > then another date.

Any ideas?

Thanks for your help
Labels (1)
0 Kudos

(4) Replies
girishkatti123
Level 7

Check out
FeatureFileInfo ( szFeatureSource, szFeature, szFile, nInfo, nvResult, svResult );
0 Kudos
RobertDickau
Flexera Alumni

If you can express your other date in yyyy-mm-dd form, too, a straight string comparison should do what you want.
0 Kudos
Aaron_Barnett
Level 5

The StrCompare function compares two strings. The comparison is not case sensitive.

Syntax
StrCompare ( szStringA, szStringB );


you think this will return 1 if StringB is a more recent date then StringA?
0 Kudos
RobertDickau
Flexera Alumni

Correct, on a character-by-character basis, "2010-03-01" follows "2010-02-28", "2009-12-31", etc., so as long as all strings use that format (no shortening the month to one digit, and so on) you should be fine.
0 Kudos