This one time, at band camp, Phil Scarratt <[EMAIL PROTECTED]> wrote:

> None that I know of. You'd have to feed something like
> 
> preg_replace("/(\d{1,2})\/(\d{1,2})\/(\d{2,4})/","\\2/\\1/\\3","11/12/2003")
> 
> to the strtotime function.

Or a little function to yankify the date..

<?php                                                                                  
                                          
// make sure we know its broken
error_reporting(E_ALL);                                                                
                                                       
// set date to 11th of December (ozzy mode)
$oz_date='11/12/03';
echo 'Ozzy date is '.$oz_date.'<br />';
                                                                                       
              
// now we can echo out the yank equivalent
echo 'The yank equivalent is '.yank_date($oz_date).'<br />';                           
                                                                                       
          
// or do some hoopy tricks with the date
echo 'or the longer version is '.date("F d Y", strtotime(yank_date($oz_date)));
                                                                                       
                        
function yank_date($date){
                                                                                       
                        
// split the date into bits
list($day, $month, $year)=split("/", $date);
                                                                                       
   
// build a yank date
$yank_date=$month.'/'.$day.'/'.$year;                                                  
                                                                          
// return the new yank date
return $yank_date;
}

?>


-- 
 ______                              
(_____ \                             
 _____) )  ____   ____   ____   ____ 
|  ____/  / _  ) / _  | / ___) / _  )
| |      ( (/ / ( ( | |( (___ ( (/ / 
|_|       \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to