in reply to comparing 2 file time date stamps

Have you considered using the -M file test operator to determine the newest file?