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 Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help with date command netrom Shell Programming and Scripting 9 08-05-2008 10:37 PM
Help with a Date Command !!! kumarsaravana_s UNIX for Dummies Questions & Answers 1 05-28-2007 12:33 PM
Date Command -1 greengrass UNIX for Dummies Questions & Answers 4 01-24-2007 02:18 PM
date command vshyam4949 UNIX for Dummies Questions & Answers 2 01-30-2006 07:40 AM
Date Command saldana UNIX for Dummies Questions & Answers 2 02-05-2004 07:50 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2008
Registered User
 

Join Date: Jul 2007
Posts: 99
Stumble this Post!
date command help

Hi,

I have the following date command for getting the below result:

`date '+%m%d%y'`

Result:

043008

Can someone help me make change in command so that i have the result as

04302008

Sorry that its a very easy for experts here , but i am a newbie. Please help

Thanks,
Sandeep
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-30-2008
redhead's Avatar
Registered User
 

Join Date: Feb 2002
Location: Denmark
Posts: 48
Stumble this Post!
`date '+%m%d%Y'`
Reply With Quote
  #3 (permalink)  
Old 04-30-2008
Registered User
 

Join Date: Jul 2007
Posts: 99
Stumble this Post!
Thats the same command that i have pasted.

Thanks,
Sandeep
Reply With Quote
  #4 (permalink)  
Old 04-30-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,844
Stumble this Post!
No, it is not.

%Y = four digit year
%y = two digit year

Sit down, open the man page for date. Scroll down until you hit the format section.
There you will find how to change date output. This page is also important because other functions in languages like perl and C use the same format control.
Reply With Quote
  #5 (permalink)  
Old 04-30-2008
Registered User
 

Join Date: Jul 2007
Posts: 99
Stumble this Post!
yes i see that. Thanks so so much for the explanation. this works..i appreciate it

thanks,
sandeep
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:30 AM.


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

Content Relevant URLs by vBSEO 3.2.0