- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Date conversion
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
07-28-2004 09:46 AM
07-28-2004 09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 09:51 AM
07-28-2004 09:51 AM
Re: Date conversion
date %d%b%y
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 09:51 AM
07-28-2004 09:51 AM
Re: Date conversion
DATE=$1
DAY=$(echo ${DATE} | cut -c 1-2)
MONTH=$(echo ${DATE} | cut -c 3-5)
YEAR=$(echo ${DATE} | cut -c 6-7)
echo "${DAY}-${MONTH}-${YEAR}"
Invoke it as:
# conv_date 01Jan04
And the output should be:
01-Jan-04
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 09:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 09:55 AM
07-28-2004 09:55 AM
Re: Date conversion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 09:56 AM
07-28-2004 09:56 AM
Re: Date conversion
perl -p -e 's/(..)(...)(..)/$1-$2-$3/' inpfile >outfile
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 12:19 PM
07-28-2004 12:19 PM
Re: Date conversion
perl -pe 's/(\D+)/-$1-/' infile > outfile
Now this of course will only work with the very simple examples you show.
Just for grins,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 05:42 PM
07-28-2004 05:42 PM
Re: Date conversion
# perl -wMDate::Manip -e'$dt=UnixDate($string,"%d-%b-%Y");
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 05:43 PM
07-28-2004 05:43 PM
Re: Date conversion
# perl -wMDate::Manip -e'$dt=UnixDate($string,"%d-%b-%Y")'
where $string is your date
if the dates are in a file
# perl -wMDate::Manip -pe'$_=UnixDate($_,"%d-%b-%Y")' file
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 06:00 PM
07-28-2004 06:00 PM
Re: Date conversion
Use in the following form date "+%d-%h-%y"
# date "+%d-%h-%y"
29-Jul-04
#
-Saravanan