10 More Discussions You Might Find Interesting
1. HP-UX
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I am using KSH shell and need to subtract n number of days from the current date .. kindly suggest !
Thanks in advance!:) (20 Replies)
Discussion started by: dev.devil.1983
20 Replies
3. Shell Programming and Scripting
Hi ,
How can I add/substruct x number of days with date?
For example
My_Date=`date`
Now I need
Hope it's clear. (2 Replies)
Discussion started by: Anupam_Halder
2 Replies
4. UNIX for Dummies Questions & Answers
Hi Gurus!
I have a static date in a YYYYMMDD format; and I want get the date 2 years in the past and 2 years in the future.
static_date=20010203
old_date=$static_date - 3 years
future_date=$static_date + 2 years
I was only able to research on dates that are current and not on static... (3 Replies)
Discussion started by: kokoro
3 Replies
5. Shell Programming and Scripting
Hi,
I want to subtract 'n' days from the current timestamp in a k shell script. Is there any inbuilt function to do it
or any workaround solution to get the date. And I want the output to be in YYYY:MM:DD HH:MM:SS format. Please help.
Thanks in advance. (4 Replies)
Discussion started by: Suryaaravindh
4 Replies
6. Shell Programming and Scripting
I am trying to find out the number of days between the current date and user defined date.
I took reference from here for the date2jd() function.
Modified the function according to my requirement. But its not working properly.
Original code from here is working fine.
#!/bin/sh... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies
7. Shell Programming and Scripting
Hi i am writing a cron job.
so for it i need the 60 days old date form current date in variable.
Like today date is 27 jan 2011 then output value will be stote in variable in formet Nov 27.
i am using EST date, and tried lot of solution and see lot of post but it did not helpful for me. so... (3 Replies)
Discussion started by: Himanshu_soni
3 Replies
8. Shell Programming and Scripting
Hi,
Anybody knows how to get what date was 28 days ago of the current system date through UNIX script.
Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy
15 Replies
9. UNIX for Dummies Questions & Answers
how can we add or subtract days from the output of date command in unix...
like if i want to subtract a day from the result of date command like this..
v_date=`date +%Y%m%d`
this wud give me 20080519
now i want to subtract one day from this.. so tht it wud give me 20080518..
how do i do... (1 Reply)
Discussion started by: St.Fartatric
1 Replies
10. Shell Programming and Scripting
Hi i am trying to subtract days from current date. For example todays date is 10/03/2006. If i subtract 2 days it should give 8/03/2006. I am also trying to find the access date of a file in dd/mm/yyyy format. Can any one please help in how to do this.
Ramesh (1 Reply)
Discussion started by: rameshspal
1 Replies