Date comparison in file to system time

I have a CSV (comma separated vaule) file whose entries resemble

Area,\\ntsvsp02\vmcs\download\files\Areas.dat,1,20090303,0,Import Complete,2009-03-02 04:23:00
Product,\\ntsvsp02\vmcs\download\files\items.dat,1,20090303,0,Import Complete,2009-03-02 04:23:00
Store,\\ntsvsp02\vmcs\download\files\Stores.dat,1,20090303,0,Import Complete,2009-03-02 04:25:00
Region,\\ntsvsp02\vmcs\download\files\Regions.dat,1,20090303,0,Import Complete,2009-03-02 04:25:00
LineList,\\ntsvsp02\vmcs\download\files\linelist.dat,1,20090301,0,Import Complete,2009-03-01 06:27:00
RangingDates,1,20090302,20090303,17,0,Export Complete,2009-03-01 19:54:00
FutureModuleList,1,20090302,20090303,6,0,Export Complete,2009-03-01 06:00:00
StoreDescription,1,20090303,20090304,5,0,Export Complete,2009-03-02 05:00:00
StoreToDisplay,1,20090303,20090304,5,0,Export Complete,2009-03-02 05:18:00
FutureStoreToDisplay,1,20090302,20090303,6,0,Export Complete,2009-03-01 06:05:00
FutureStoreDescription,1,20090302,20090303,6,0,Export Complete,2009-03-01 06:06:00
Module,1,20090302,20090303,15,0,Export Complete,2009-03-01 15:00:00
ModuleDispOpt,1,20090302,20090303,15,0,Export Complete,2009-03-01 15:01:00
DispOptProduct,1,20090302,20090303,14,0,Export Complete,2009-03-01 15:10:00
StoreDispOpt,1,20090302,20090303,15,0,Export Complete,2009-03-01 15:13:00
StoreItem,1,20090302,20090303,13,0,Export Complete,2009-03-01 14:06:00

I need to a command (I think awk could be helpful?) which will scan the last column (i.e. the date and time) and set a variable called TIME_EXCEEDED to one (1) i.e. TIME_EXCEEDED=1 if the if they (any one of the last column entry) are older than 24 hours (when being compared to the system time).

Please let me know if the above information was helpful

Could kindly advise if had a chance to look at this.

One way is :

YESTERDAY=`perl -e '@T=localtime(time-'86400');printf("%02d-%02d-%02d %02d:%02d:%02d ",($T[5]+1900,$T[4]+1,$T[3],$T[2],$T[1],$T[0]))'

`

Then use this YESTERDAY variable as using -v in nawk e.g.

TIME_EXCEEDED=`nawk -F, -v YEST="$YESTERDAY" ' BEGIN {OK="0"} { if ( $NF < YEST ) OK="1"  } END { print OK } ' FILENAME `

pnm

Thanks a lot for the solution. It is working :).

:b: