10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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