- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Converting date output
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 09:59 PM
09-30-2003 09:59 PM
I have a part of a script which outputs the date as 03/08/11 to represent 11th August 2003.
How can I set the date variable so that this is output as 11 Aug 2003
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:04 PM
09-30-2003 10:04 PM
Re: Converting date output
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:09 PM
09-30-2003 10:09 PM
Re: Converting date output
# date "+%d %b %Y"
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:10 PM
09-30-2003 10:10 PM
Re: Converting date output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:18 PM
09-30-2003 10:18 PM
Re: Converting date output
$date -u +"%d %b %Y"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:23 PM
09-30-2003 10:23 PM
Re: Converting date output
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:23 PM
09-30-2003 10:23 PM
Re: Converting date output
Thanks for all the answers. Let me clarify this one a little.
I do
date1=`lifls -l /tmp/LIF | grep HPUX | awk '{print$6}'`
echo $date1 gives 03/08/11. Does these answers convert this date ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:45 PM
09-30-2003 10:45 PM
Re: Converting date output
echo 10/01/03 | awk -F'/' '{print $2 " " substr ("JanFebMarAprMayJunJulAugSepOctNovDec", ($1 -1 ) * 3 + 1,3) " 20" $3}'
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 10:49 PM
09-30-2003 10:49 PM
Re: Converting date output
echo 03/08/11 | awk -F'/' '{print $3 " " substr ("JanFebMarAprMayJunJulAugSepOctNovDec", ($2 -1 ) * 3 + 1,3) " 20" $1}'
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 11:10 PM
09-30-2003 11:10 PM
Re: Converting date output
Many thanks for the replies. After I clarified my problem, It was Thierry who gave me a workable solution.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 11:31 PM
09-30-2003 11:31 PM
Re: Converting date output
I like your solution. Very tricky and very small instead to compare and replace.
I would give you 10 Points.
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:06 AM
10-01-2003 03:06 AM
Re: Converting date output
Very smooth. I have filed off the serial number and called it my own...
Tim