![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| changing format | shary | Shell Programming and Scripting | 4 | 01-31-2008 02:20 AM |
| changing the format of date | nasirgondal | Post Here to Contact Site Administrators and Moderators | 1 | 06-07-2006 10:37 PM |
| How to print current month - 1 in string format | mogli4 | Shell Programming and Scripting | 3 | 03-10-2006 01:47 PM |
| Changing date format | Sabari Nath S | Shell Programming and Scripting | 5 | 12-07-2005 12:38 AM |
| Changing the date format | Dream86 | Shell Programming and Scripting | 10 | 06-08-2005 10:35 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Getting month and changing format
Hello,
I would like to get todays moth and write it in this format: _06_ Any ideas? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
don't know about todays moth, but to get the current month:
Code:
echo _`date '+%m'`_ |
|
#3
|
|||
|
|||
|
Or:
Code:
date "+_%m_" |
|
#4
|
||||
|
||||
|
Code:
echo "_"$(date '+%m')"_" _05_ |
|
#5
|
|||
|
|||
|
I meant the current month... Didn't make myself clear...
I want to use it in a link, so that say the month is January, _01_ is written into the link.. |
|
#6
|
|||
|
|||
|
Thanks for the quick response. I'm a no good programmer. How would you use this...
I tried: Code:
my $month=echo(""_"$(date '+%m')"_"");
|
|
#7
|
||||
|
||||
|
The following will assign the month as a number to a variable.
Code:
> curr_mth=$(echo "_"$(date '+%m')"_") > echo $curr_mth _05_ > |
||||
| Google The UNIX and Linux Forums |