Date conversion from DD MON YY to mmddyyyy


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Date conversion from DD MON YY to mmddyyyy
# 1  
Old 05-12-2011
Date conversion from DD MON YY to mmddyyyy

I am new shell scripting.
Can someone please help in giving a shell script to convert from DD MON YY to mmddyyyy

Example:
Input1 :- 20 Apr 2011
Output2 should be :- 04202011

Input2 :- 09 MAR 11
Output :- 03092011

Input3 :- 30_JAN_11
Output :- 01302011

Need help in writing shell script in coverting all the 3 above examples.

Thanks in advance for all your help.Smilie
# 2  
Old 05-13-2011
Sorry, but i have to ask: is this homework?

Anyways, this thread doesn't have anything AIX-related so i move it over to "Shell Programming and Scripting".

-push-

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date conversion help from dd/mm/yyyy to dd/Mon/yyyy i.e. 28/10/2012 to 28/Oct/2012

Hi I have a problem with Date format in my code. 1st I am trying to convert today's date to yesterday's using YESTERDAY3=`perl -e '@y=localtime(time()-86400); printf "%04d/%02d/%02d",$y+1900,$y+1,$y;$y;'` And once it is done I am trying to using the yesterday date in a grep command to... (3 Replies)
Discussion started by: nithinankam
3 Replies

2. Shell Programming and Scripting

Converting Date from YYYYMMDD to DD-MON-YYYY

Hi , I need to convert date from YYYYMMDD to DD-MON-YYYY e.g 20111214 to 14-Dec-2011 Please help. (17 Replies)
Discussion started by: ady_koolz
17 Replies

3. Shell Programming and Scripting

Converting date DD MM YYYY to DD MON YYYY

Hello, I am writing a script that parses different logs and produces one. In the source files, the date is in DD MM YYYY HH24:MI:SS format. In the output, it should be in DD MON YYY HH24:MI:SS (ie 25 Jan 2010 16:10:10) To extract the dates, I am using shell substrings, i.e.: read line ... (4 Replies)
Discussion started by: Adamm
4 Replies

4. Shell Programming and Scripting

Julian date to Calendar date conversion

Hi all, I require to convert julian date to normal calander date in unix for eg julian date=122 now i want corresponding calander date ---------------------------------------- gr8 if give very small command/script and please explain the steps as well(imp) Thanks ... (3 Replies)
Discussion started by: RahulJoshi
3 Replies

5. Shell Programming and Scripting

Change the date format from mmddyyyy to yyyymmdd

How do I change the date format from mmddyyyy to yyyymmdd in PERL. Can any one help me please. (3 Replies)
Discussion started by: thankful123
3 Replies

6. Shell Programming and Scripting

PERL String to Date (Custom format yyyymmdd to dd-mon-yyyy)

Hi All, I am learning PERL for one of the projects, and in one of these scripts, I read a flat text file and print in the terminal. The problem is, the text file has a date field. The format is yyyymmdd. I need to display this as dd-mon-yyyy. Any ideas to do this? Thanks a lot for the... (9 Replies)
Discussion started by: guruparan18
9 Replies

7. Shell Programming and Scripting

Conversion of date to Julian date

Hi Gurus, Need help in Conversion of date(2007-11-30) to Julian date(YYDDD)... '+%J' 2007-11-30 to 'YYDDD' Thanks (4 Replies)
Discussion started by: SeenuGuddu
4 Replies

8. UNIX for Dummies Questions & Answers

perl yesterday's date in mmddyyyy format

Hi, Below command is producing yesaterday's date in mmddyy format - perl -e '@T=localtime(time-86400);printf("%02d%02d%02d",$T+1,$T,($T+1900)%100)' But i want the date in mmddyyyy format; plz help. Thankx, Rahul Bahulekar. ---------- Post updated at 05:13 AM ---------- Previous... (1 Reply)
Discussion started by: rahulbahulekar
1 Replies

9. Shell Programming and Scripting

Unix date Format (MON)

Hi , Can any one give me what is the date format for 3 character Month all caps (MON) when I do date +%b it will give me Sep But I want this to be SEP (all caps) . Thanks in advance (1 Reply)
Discussion started by: umathurumella
1 Replies

10. Shell Programming and Scripting

How to use "date" to get dd-mon-yy

I know "date +%d-%m-%y" gives me 02-04-08, but how to easily get "02-Apr-08", i.e. the month has the three letter format. I need to use this "02-Apr-08" format to feed an Oracle database. Thanks a lot! (3 Replies)
Discussion started by: fld2007
3 Replies
Login or Register to Ask a Question