Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

datetimestamp related query!

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-03-2009   -   Original Discussion by smarty86
smarty86's Unix or Linux Image
smarty86 smarty86 is offline
Registered User
 
Join Date: Dec 2008
Last Activity: 11 May 2012, 2:40 AM EDT
Posts: 88
Thanks: 4
Thanked 0 Times in 0 Posts
datetimestamp related query!

Hi all,

I have put a query in a thread but didn't get any reply. Hoping to get a reply here.

I have a file in that one line resembles like below...



Code:
 
Forwarded by Deepak on 11/15/2009 10:28 AM EST

ofcourse AM can be PM also...

so what i need is first i need to get only "11/15/2009 10:28 AM EST"
from the line..

then I need to change the time to 24hr format....

if it is EST after AM/PM then let the time be same as given..

if it is AST instead of EST deduct 9.5hrs from the given time.

if nothing is there after AM/PM then deduct 9.5hrs from the given time.

so the final output should be in the form of mm/dd/yyyy hh:mm


Please help me guys...

---------- Post updated 11-03-09 at 01:19 AM ---------- Previous update was 11-02-09 at 11:35 PM ----------

help me guys
Sponsored Links
    #2  
Old Unix and Linux 11-03-2009   -   Original Discussion by smarty86
Franklin52's Unix or Linux Image
Franklin52 Franklin52 is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 8 May 2018, 10:20 AM EDT
Location: The Netherlands
Posts: 7,747
Thanks: 139
Thanked 558 Times in 520 Posts
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Proceed here:

https://www.unix.com/shell-programmin...mm-format.html

Thank You.

The UNIX and Linux Forums.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
query related to if sainathdeg Shell Programming and Scripting 1 08-26-2008 08:49 AM
Print related query sapan123 Shell Programming and Scripting 1 08-09-2008 04:54 AM
awk related query abhisek.says UNIX for Dummies Questions & Answers 2 05-22-2008 02:49 AM
sed related query gopsman Shell Programming and Scripting 1 11-30-2007 08:03 AM
Query related to #!/bin/sh sureshg_sampat Shell Programming and Scripting 2 02-08-2007 04:54 AM



All times are GMT -4. The time now is 04:23 PM.