Actual date minus six months (HP UX)

Thread Tools Search this Thread
Operating Systems HP-UX Actual date minus six months (HP UX)
# 1  
Old 01-20-2014
Actual date minus six months (HP UX)

Hi there,

is it possible to get the actual date minux six months with just a simple command?

It's easy with Linux but on HP Unix (for me) impossible Smilie

Best wishes
# 2  
Old 01-20-2014
Check this thread: Date Arithmetic
# 3  
Old 01-20-2014
There is also my General Purpose Date Script, a Perl stand-in that requires no special modules. It's far more limited than the "real" GNU date but handles ./ -d "now - 6 months" easily.
# 4  
Old 01-20-2014
Alternatively you could download and install the GNU Utilities Coreutils - GNU core utilities
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to minus one day from a date given

Hello Folks, I have a variable output holding date as below - output = "20141220" I need to extract a day out of it and store it in another variable i.e. something similar to below - output1=20141219" and if the month is changing i.e. date in on 31st or 1st it should be taken care of "date... (5 Replies)
Discussion started by: ektubbe
5 Replies

2. Shell Programming and Scripting

Subtracting months from passed Date

Hi All, I am getting a date from environment variable and want to do some processing by subtracting 2 months from the date passed through the environment variable. I am trying the following syntax : date_var=2014-08-31 date_2M_ago='$date_var+"%d%m%y" --$date_var="2 months ago" '... (3 Replies)
Discussion started by: Rahul Raj
3 Replies

3. Shell Programming and Scripting

Date minus 1 day

Hi the below code is failing i am trying to generate do the following: 2014-10-22 11:26:00 (Substract 24 hrs) should produce 2014-10-21 11:26:00 I need the same formatting below because that gets inputted into code for an... (4 Replies)
Discussion started by: Samuel12
4 Replies

4. Shell Programming and Scripting

Subtract months/days from date

Hi, Can you please let me know code for the below (in korn shell) a) Subtract month(s) from given date b) Subtract day(s) from give date c) Subtract month(s) from given timestamp d) Subtract day(s) from give timestamp (1 Reply)
Discussion started by: tostay2003
1 Replies

5. Homework & Coursework Questions

How to minus 2 month from current date?

I am running a script in ksh to get the 2 months back date from system date.The below code is giving correct date output from putty command prompt.But while running the script is .ksh file it is giving the error below.Please suggest. ; d=a; y=a m-=num while(m < 1) {m+=12; y--}... (1 Reply)
Discussion started by: hini
1 Replies

6. Shell Programming and Scripting

How to replace actual generated date with sysdate?

Hi, currently I've a file with the following content: insert into CD_CARD_TYP (code, description, last_update_by, last_update_date) values ('024', '024', 2, to_date('29-03-2008 05:16:09', 'dd-mm-yyyy hh24:mi:ss')); insert into CD_CARD_TYP (code, description, last_update_by,... (1 Reply)
Discussion started by: jediwannabe
1 Replies

7. Shell Programming and Scripting

current date - 8 months in perl script

I have a requirement as follows. when i pass a date to the perl script, it has to calculate the current date - 8 months and output the date back to the shell script in date format (YYYY-MM-DD). Current date - 8 months is not constant.. because leap year, and the months jan, mar, may,.... has... (4 Replies)
Discussion started by: kmanivan82
4 Replies

8. UNIX and Linux Applications

sqlite: calculating with dates - compare current date minus 6 months with stored record

Hi I have a table with name, date in format DD.MM.YYYY. I need to something like this (I try to explain in pseudo code) if SYSDATE (current date) minus 6 months > $expiry date print OK else print NOK with $name and $expiry date I know this is possible with Oracle. How to do this... (0 Replies)
Discussion started by: slashdotweenie
0 Replies

9. Shell Programming and Scripting

How to get date n months before in Unix?

Hi, I need the date n months before currrent date I need to store date in a varible say x and then get the date 6 month before and get the result in the format 25-Aug-2009 Please Advice (7 Replies)
Discussion started by: mad_man12
7 Replies

10. UNIX for Advanced & Expert Users

Subtract 2 months from the date

I have the script which appends month and year to the name of the file. Now every time when I append the month-year combination I have to subtract 2 months from the current date and then append it, since we are sending our vendor 2 months prior worth of data eveytime. #! /usr/bin/ksh ... (5 Replies)
Discussion started by: mahekr2000
5 Replies
Login or Register to Ask a Question