HowTo: reg expr doing grep "timestamp>$DesiredTime" logfile ?

I know I asked a similar question but I want to know if there is a regular expression existing that with a korn shell cmd, finds any timestamp data records in a file where it is greater then a timestamp in a shell variable ?

something like :

grep all records where it has a timestamp > $DesiredTime from logfile-X

It would simplify my coding alot for what I want to do on the client's AIX 4.2

Any ideas ?

How does the format of the dates lookes like in your log file?

like the standard `date` output:

I know I could always do a regular expression to match each date parts. But I need to know if there a special one that will allow me something like :
grep all records in file where any timestamp in it is > $a_given_timestamp

For that I afraid you have to convert your timestamp to min or sec's before comapring it with the given timestamp(that should be also in min or in sec's)

To match dates you can use a format like YYYYMMDDHH, an example to convert the date format Mar 17 16:44:03 2009 to 2009031716

echo "Mar 17 16:44:03 2009"|
awk -F" |:" '
BEGIN {
  a="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"
  split(a,m,",")
  for(i=1;i<13;i++)
    n[m]=i
}
{printf("%s%02d%02d%s\n", $6, n[$1], $2, $3)}
'

Use nawk or /usr/xpg4/bin/awk on Solaris if you get errors.