Welcome to the most active Linux Forum on the web.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.


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

Rep: Reputation: 36
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, 02:05 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,570

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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! LinusStallman Linux - General 5 12-14-2010 03:52 AM
[SOLVED] how to get the days from a certain date? snowball0916 Linux - Newbie 4 12-12-2010 01:47 AM
[SOLVED] Use date with touch to create new file with date based name craigjl Linux - Newbie 5 03-12-2010 09:46 AM
Trouble with a script to manipulate files within a large number of directories zorblart Programming 1 01-10-2009 02: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 12:12 PM

All times are GMT -5. The time now is 01:13 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