To get the time exactly 24hrs from the current time

Hi guys,

I am having file which contains below data.

2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-04-24 08:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-07-05 07:40:13     10739022730     1027699274PersonInfoShipTO details missing      FirstName,LastName,
2012-07-05 11:40:13     10739022730     1027699274PersonInfoShipTO detailsmissing      FirstName,LastName,
2013-07-05 08:40:13     10739022730     1027699274PersonInfoShipTO detailsmissing      FirstName,LastName,

First column represent the time stamp .My requirement is whenever i run my script it needs to go through the above file and should grep the line in which the time stamp should be between current time and 24hrs.
i.e
If i run the script by July 6 ,2013 10.00 pm ct then output should contains the date from July 5 ,2013 10.00 pm ct to July 6,2013 10.00 pm CT.
My OS version is

SunOS 

Thank u guys.

You will need to use C or perl or or ruby -- some language. bash, ksh, nawk and other standard utilities that come with Solaris do not "do dates" like the GNU coretuils do.
So if someone posts an example using "date" or "awk" it will not work unless you have the GNU coreutils installed.

Here is a C example, someone else may post a perl example.

// tsrch.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
//compile [g]cc -o tsrch tsrch.c
// usage ./tsrch < filename_to_search  NOTE the "<"

time_t then(const char *tmp)
{
    char *fmt="%Y-%m-%d %H:%M:%S ";
    struct tm tm;
    if(strptime(tmp, fmt, &tm)==NULL) // bad text in line
       return (time_t)0;
    
    return (time_t) mktime(&tm);
}

int main()
{
   time_t now=time(NULL);
   char tmp[1024]={0x0};
   while( fgets(tmp, sizeof(tmp), stdin)!=NULL )
   {    
      if(strlen(tmp)> 24 && 
         now - then(tmp) <=86400)  // seconds in 24 hours
      printf("%s", tmp);   
   }
   
   return 0;
}

/usr/sfw/bin/gcc (C compiler) is part of the standard Solaris 10 && 11 install

Since your date format is sortable you could calculate the 24hour time using perl and then use a simple nawk script like this:

24hr.pl

#!/bin/perl
use POSIX; print strftime('%Y-%m-%d %H:%M:%S', localtime(time() - 24*60*60));

Then use this (24hr.pl executable and in current directory):

FROM=`./24hr.pl`
awk "\$0 > \"$FROM\"" infile