The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
changing the format of date in unix trichyselva UNIX for Dummies Questions & Answers 5 03-20-2008 10:07 AM
convert mmddyy date format to ccyyddd format?? Bhups Shell Programming and Scripting 2 09-27-2006 08:30 PM
changing the format of date nasirgondal Post Here to Contact Site Administrators and Moderators 1 06-07-2006 10:37 PM
Changing the format of date nhatch UNIX for Dummies Questions & Answers 4 04-11-2006 07:17 AM
Changing date format Sabari Nath S Shell Programming and Scripting 5 12-07-2005 12:38 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 06-08-2005
Lestat's Avatar
Registered User
 

Join Date: Feb 2005
Location: Quito - Ecuador
Posts: 67
Try using:

FECHA=`date '+%m_%d_%C%y'`
echo "$FECHA"

This might work.

Lestat
Reply With Quote
Forum Sponsor
  #9  
Old 06-08-2005
Registered User
 

Join Date: Jun 2005
Posts: 5
Quote:
Originally Posted by Lestat
Try using:

FECHA=`date '+%m_%d_%C%y'`
echo "$FECHA"

This might work.

Lestat
Thank you for your response.

But i still get the same out put with 0's for month and day present
for example 06_08_2005 (instead of 6_8_2005)

Nina
Reply With Quote
  #10  
Old 06-08-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
FECHA=`date '+%m_%d_%C%y' | sed 's/^0//;s/_0//'`
Reply With Quote
  #11  
Old 06-08-2005
Registered User
 

Join Date: Jun 2005
Posts: 5
Quote:
Originally Posted by vgersh99
FECHA=`date '+%m_%d_%C%y' | sed 's/^0//;s/_0//'`
Great, thank you very much

I just needed to add a '_' (FECHA=`date '+%m_%d_%C%y' | sed 's/^0//;s/_0/_/'`) to make it exactly as the format i needed it to be
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0