Well if you have a consistent format (like Month Day, FullYear) then you could
do this:

  function get_unix_stamp($date)
  {
    $months = array('Jan' => 1,'Feb' => 2,
                    'Mar' => 3,'Apr' => 4,
                    'May' => 5,'Jun' => 6,
                    'Jul' => 7,'Aug' => 8,
                    'Sep' => 9,'Oct' => 10,
                    'Nov' => 11,'Dec' => 11);
    $foo = explode(' ',$date);
    $month = $months[$foo[0]];
    $day = str_replace(',',$foo[1]);
    $year = $foo[2];

    return mktime(0,0,0,$month,$day,$year);
  }

--Joe

On Fri, Mar 02, 2001 at 06:58:45PM -0500, Fang Li wrote:
> Hi, All,
> I am stucked here.Would you please help as soon as you can?
> 
> LiveDate = "Mar 12,2001"
> 
> how to convert it to a int?
> 
> mktime(0,0,0,?,?,?)
> Because the LiveDate is changable, I could't put a 3,12,2001 in the mktime.
> 
> Thanks a lot.
> 
> Fang
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to