Unix, awk to read .ksh feed

I need some advice, I have live feed containing xml messages which means there is new messages every minute. I need a script that will run every 2 hours using the current time minus 2 hours ( which I able to do) However I have problem with the date formatting i.e.

One date is 27102011:15:30:00
Second date is 2710201115300

Which means when I try to compare the two dates I can't do so because of the formatting.

The first date is from the xml message which I extract using awk code, is there away to change the date format and compare the two dates.
I store the first date in variable can I store the second date in variable. Is there away to do so?

I execute the file using ./filename.ksh | awk

Is there another way to do so?

Is there a way to read this feed every 2 hours and extract the data for these to hours only?:wall:

Can someone please advice me the best way to do this.

Is this live feed replaced or extended every two hours?

just remove all non-numeric chars from the first date and compare the dates as integers. Where do you compare the dates? In shell or in awk?
If in awk:

...
myDateFromXml="27102011:15:30:00"
gsub("[^0-9]", "", myDateFromXml)

This is live feed which runs on the background, meaning it contains the data for the day and I need to run script and will get data from 2 hours minus the current time.

Sorry I am not explaining myself