Computing.Net > Forums > Unix > change date format using shell

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

change date format using shell

Reply to Message Icon

Name: vmtrt
Date: February 25, 2005 at 14:45:03 Pacific
OS: HP-UX
CPU/Ram: 256 ram
Comment:

Hi all,
I am trying to change the date format from MM/DD/YYYY to MMDDYYYY in the fixed width file using shell. dates are in fields 19-28 and 29-38.

Any help is greatly appreciated. Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: gurubit
Date: March 2, 2005 at 04:32:43 Pacific
Reply:

I guess you want to format the date in your required format using the shell script.
You need to use
date '+%m' - Month
date '+%d' - Day
Parse the date '+%c' and get the year. you can use the 'cut' command and get the reqd. field.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: change date format using shell

UNIX/changing date format www.computing.net/answers/unix/unixchanging-date-format/8440.html

Prb in Yest'days Date Format www.computing.net/answers/unix/prb-in-yestdays-date-format/4559.html

Time diff and date formatting prob www.computing.net/answers/unix/time-diff-and-date-formatting-prob/5065.html