LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Date comparisons ... (https://www.linuxquestions.org/questions/linux-newbie-8/date-comparisons-943062/)

muralimunna 05-03-2012 04:21 AM

Date comparisons ...
 
how can i compore date in linux....using timestamps

muralimunna 05-03-2012 04:22 AM

how can i compare 10/01/2009 with current date

chrism01 05-03-2012 07:15 PM

Read this to see how to get current date in required format http://linux.die.net/man/1/date, then split each string using either bash built-ins or eg cut or awk and compare each field separately.

Show us your code if you get stuck.

jlinkels 05-03-2012 10:18 PM

Comparing dates is best done using timestamps. Refer to the man page chrism01 gave you. Convert a date to a time stamp and do the arithmetic.

jlinkels


All times are GMT -5. The time now is 05:29 AM.