Help answer threads with 0 replies.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.


  Search this Thread
Old 03-02-2012, 05:01 AM   #1
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 37
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.
#  date +%Y-%m-%d --date="2012-03-31 - 183 days ago"
Is there any solaris equivalent command to do the same?
Old 03-02-2012, 03:05 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,724

Rep: Reputation: 434Reputation: 434Reputation: 434Reputation: 434Reputation: 434
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Offline method required to find out number of days since a certain date! linustalman Linux - General 5 12-14-2010 04:52 AM
[SOLVED] how to get the days from a certain date? snowball0916 Linux - Newbie 4 12-12-2010 02:47 AM
[SOLVED] Use date with touch to create new file with date based name craigjl Linux - Newbie 5 03-12-2010 10:46 AM
Trouble with a script to manipulate files within a large number of directories zorblart Programming 1 01-10-2009 03:11 AM
How do I calculate the number of days from a particular date using the <cal> utility? deepumnit Linux - Desktop 3 12-31-2007 01:12 PM > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration