LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-02-2012, 04:01 AM   #1
pinga123
Member
 
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.
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: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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



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 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

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration