I have in my database,a field called "inserted" which is a datetime. Now I have a variable in my Perl script that contains another datetime value. I want to compare these two dates to find out which one is more recent.
However I have no clue on how to do this. Please help me guys.
Ask the database to return the results where the datetime field has been altered to the format Perl is using. It's been too long for me to remember such details, unfortunately.
Preferably you can get them in YYYY-MM-DD HH:MM:SS format as these sort themselves naturally when compared.
Hi i've tried using timelocal in my localhost and it worked fine. I was able to convert both dates to seconds so i was able to know which was more recent. However when i uploaded the script to the server I got this error:
Undefined subroutine &main::timelocal. Please help me fix this