LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 03-02-2012, 04:01 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 676
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.
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?
 
Old 03-02-2012, 02:05 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,505

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


Reply


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 06:04 PM.

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