On 20 Mar 2004 Jeff Oien wrote:

> How do I convert this
> 9/8/2001
> (which is Month/Day/Year)
> to this
> 20010908
> (YearMonthDay - with leading zeros)

How about:

<?php
        $date = '9/8/2001';
        list($mm, $dd, $yy) = explode('/', $date);
        print(sprintf('%4d%02d%02d', $yy, $mm, $dd));
?>

--
Tom




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to