How to validate the user supplied timestamp?
Ther requirement is as follows.
While invoking the script, the parameters passed to the script are minimum and maixmum timestamps.
let's say min_tstmp and max_tstmp
ksh abc.ksh 2011-09-01-00:00:00 2011-12-01-00:00:00
so min_tstmp=2011-09-01-00:00:00
and max_tstmp=2011-12-01-00:00:00
now i need to validate the min_tstmp and max_tstmp whether it is a valid timestamp or not.
If min_tstmp is valid display "min_tstmp is valid" else "min_tstmp is invalid timestamp".
If max_tstmp is valid display "max_tstmp is valid" else "max_tstmp is invalid timestamp".
I know that it is bit difficult to achieve to validate this using shell script.
But it is possible using perl script.
can anyone help me out with the perl script to validate these two timestamps are valid or not.
Thanks
Krishnakanth