views:

38

answers:

1

I am coding in php, attempting to get the start\end dates and times for events. I am utilizing the following RegEx for parsing out the information:

$pattern='/(?P<StartDate>[0-9]{8})T(?P<StartTime>[0-9]{6})
.+(?P<EndDate>[0-9]{8})T(?P<EndTime>[0-9]{6})/';

The sample event entry is here:

BEGIN:VEVENT
UID:34b09fd7-8e6e-4d56-86b0-445745b89d93
ORGANIZER;CN=*********:mailto:*********
DTSTART;TZID="(GMT-06.00) Central Time (US & Canada)":20100413T130000
DTEND;TZID="(GMT-06.00) Central Time (US & Canada)":20100413T160000
STATUS:CONFIRMED
CLASS:PRIVATE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
TRANSP:OPAQUE
X-MICROSOFT-DISALLOW-COUNTER:TRUE
DTSTAMP:20100414T140711Z
SEQUENCE:0
END:VEVENT

20100413T130000 and 20100413T160000 are the start and end points.

The dates are straight forward, however how do I interpret the time part?

This event starts at one and ends at four.

+2  A: 

They are in HHmmss format where HH is the hours in a 24 hour format. 130000 is 13:00:00, ie. 1 pm (13 - 12 = 1 pm), 0 minutes, 0 seconds.

Ahmad Mageed
I don't know why I didn't see that after staring it. Thank you.
Josh