CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Date and time format: Edit Log



ogit2
Novice

Mar 23, 2018, 4:09 AM


Views: 5807
Date and time format

Hi

I have data come in that I need to extract the date and first time and then update the system by calculating one day prior. I can easily do the one day prior calculation so that part is not a problem.

Unfortunately this data is entered by our customer as free text. I am not going to embarrass myself by entering the code I have used so far to extract date and time as it is too convoluted and fails 10% of the time.

I don't believe there is a solution that would cope with the sample data listed below (results required after arrow -->). The experts here may have an idea to use some sort of AI (never done this in Perl - Any modules need to compile with Active state) so any pointers would be appreciated.

If I am asking the impossible, let me know.



Code
26.03.2018 @ 08:00 ref 63025 --> 26/03/2018 08:00 
26.03.2018 9am - 16:00 Fay *15ft -> 26/03/2018 09:00
25.03.2018 @ ref 1435 06:00 -> 25/03/2018 06:00
23 03 1500 ref 61436 -> 23/03/2018 15:00
fyi 2134 24/03/2018 at 4pm WP0507 -> 23/03/2018 16:00
ref 201825 at 05:04 on 25/03/2018 ref FAY -> 25/03/2018 05:04
25/03/2018 at 06:0 -> 25/03/2018 06:00
26.03.20018 4 pm 11386902* -> 26/03/2018 04:00
26.03.18 @ 20.30 -> 26/03/2018 20:30
26.03.2018 @ 23.30 ref 2234 -> 26/03/2018 23:30
26/03/2018 at 06:04 -> 26/03/2018 06:04
26.03.2018 @ 07.45 Ref RCB/26/21 -> 26/03/2018 07:45
26/03/2018 at 19:40 -> 26/03/2018 19:40
26/03/18 at 18:00 -> 26/03/2018 18:00
26 March 2018 1800 (6pm) -> 26/03/2018 18:00
26/03/2018 for 22:00 -> 26/03/2018 22:00
26 3 18 @ 14:00 ref 63026 -> 26/03/2018 14:00
26.03.2018 @ 19:00 ref 63027 -> 26/03/2018 19:00



(This post was edited by ogit2 on Mar 23, 2018, 4:29 AM)


Edit Log:
Post edited by ogit2 (Novice) on Mar 23, 2018, 4:29 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives