The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare date from db2 table to yesterday's Unix system date sasaliasim Shell Programming and Scripting 9 12-01-2008 11:37 PM
Perl: Extracting date from file name and comparing with current date MKNENI Shell Programming and Scripting 4 03-26-2008 04:01 PM
Changing Creation Date to a Prespecified Date of a File In Unix monkfan UNIX for Dummies Questions & Answers 4 11-28-2006 07:15 AM
Time Manipulations vanand420 Shell Programming and Scripting 10 07-22-2005 05:47 AM
date manipulations user1 Shell Programming and Scripting 2 07-20-2004 01:22 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-07-2006
rochitsharma rochitsharma is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 82
Date manipulations

hi

i am having a script in which i am supposed to extract data for three different dates...first date is current date
second date is 15 days back
third date is 40 days back

for eg consider todays date 26062006 as first date then
second date is 11062006
third date is 17052006

now in my script i can get first date using date command. but for second & third date i need to give values manually.due to this i am not able to automate my script. resently i got following commands...

NOW_DATE=$(date)
DATE_15=$(perl -e 'print scalar localtime(time-1296000)')
DATE_40=$(perl -e 'print scalar localtime(time-3456000)')

they do work but the problem in them is that format of month is in alphabets... i.e. month come as Aug or Sep.. etc....
where as i req it in numerical format as 08 or 09 etc ...

Thanks in advance
Rochit
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0