Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using unix date command parameters on a variable

Status
Not open for further replies.

edwardb15

Technical User
Mar 23, 2004
10
AU
i am trying to use the "date" options on a user defined date variable. is this possible?

$ user_date=`date`
$ echo $user_date
Monday January 10 15:01:25 EST 2005

$ C_DATE=`$user_date +"%a %b %e "`
 
thanks for your responses.
the $C_DATE=$user_date`date +%a%b%e` doesn't quite produce what i'm after, output:
Tuesday January 11 08:38:30 EST 2005TueJan11

the output from:
$ C_DATE=`date +"%a %b %e "`
$ echo $C_DATE
Tue Jan 11

i can format this in the output required. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top