LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   How to Manipulate Date based on number of days? (https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-manipulate-date-based-on-number-of-days-932305/)

pinga123 03-02-2012 04:01 AM

How to Manipulate Date based on number of days?
 
I have script where in i issue a command to get back 6 month earlier date.
below command works on all linux distribution.
Code:

#  date +%Y-%m-%d --date="2012-03-31 - 183 days ago"
2011-09-30

Is there any solaris equivalent command to do the same?

jlliagre 03-02-2012 02:05 PM

You are using a GNU date extension. Check if GNU date isn't already installed, might be gdate, /usr/gnu/bin/date, /opt/sfw/bin/date, /usr/local/bin/date or something like this. Otherwise, you might install it from a freeware repository or compile it from source.


All times are GMT -5. The time now is 10:52 AM.