Shift report script

hey guys, so i'm running into a wall here with my script. i simply can't figure out a way to get it to work. so, maybe you guys can help me.

i'm trying to created a report of server alerts based on the time worked. what i have so far is curling nagios pages, removing all the extra html tags and things and dumping them into two .csv files. from there it would parse out the timestamps in each file based on the hours worked. initially i had tried to read user input based on either the time my shift started, or the duration of the shift, but i've had no luck. anyways, here's a few issues i'm having

issue #1
there are graveyard shifts that span multiple days

issue#2
one page has PST timestamps and the other one has JST. so there's a difference in time between the two files. here's an example of what it would look like.

PST

09-21-2010 20:34:43
09-21-2010 21:35:33
09-21-2010 22:35:33
09-21-2010 23:35:33
09-22-2010 00:36:33
09-22-2010 01:37:43
09-22-2010 02:37:53

JST

09-22-2010 12:34:43
09-22-2010 13:35:33
09-22-2010 14:35:33
09-22-2010 15:35:33
09-22-2010 16:36:33
09-22-2010 17:37:43
09-22-2010 18:37:53

so as an example, if i ran my script at 03 PST and my shift started at 22. it would pull everything in the PST file from 22 up until that point, and for JST it would in turn pull everything from 14 up until the current time in JST.

sorry for making such a long and complicated post, but i've been at this for a solid week trying to figure it out and nothing i've tried works so far. so, any help is appreciated! thanks!

Please post your script.

well i can't really because #1 it contains information from my work that i'm not able to post, hence the reason i only included the timestamps and not the information following them. and #2. i was mostly trying to see if anyone knew theory wise how i could get around some of the issues i was having. it would help if anyone could provide example code, or code they think might work as well. lol

I'm not sure I fully understand the problem. From what I do gather, I'm thinking why not take the shift info in parts. Date the shift start, time the shift started and the number of hours worked. From there you can do some date/time math to find out the date the shift ended. From there process the file with an eye for those dates.

For question #2, do your times need to be presented differently depending on who views it? If not I'm not sure I understand the problem. Do you know which files contain PST and JST ahead of time? If so, would it be worthwhile to convert the times listed into UTC time? It would require more code and more specific input from the user. (What time zone are they putting the request in for) But it solves issues when it comes to displaying data.

Again I'm not 100% sure I understand the problem, so I'm just throwing ideas out.

yeah i already know which files have the JST and PST timestamps in them. but that actually would work. if i convert the time's to UTC it would make it alot easier to work with! yeah i'm sorry it's a little complicated and i'm not quite sure how to explain everything:....but your suggestion definitely should help in getting over that hurdle of timezones. lol thanks!:slight_smile: