Something like this would work:
=====================

<?php

 function dateConvert($date)
 {
  $newdate = "";

  $newdate .= substr($date,0,2);
  $newdate .= "-";
  $newdate .= substr($date,2,2);
  $newdate .= "-";
  $newdate .= substr($date,4,4);

  return $newdate;
 }

 echo dateConvert("04212004");
?>

"Adam Williams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi, I have a form where I have a user entering in the date in a numeric
> string.  For today they would enter 04212004 and so on...I'm working on
> this date within mysql server, and mssql server handles dates as
> 04-21-2004 when you use convert(varchar,field,110).  So how in PHP can I
> change a variable's value which is 04122004 into 04-21-2204
>
> thanks!

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

Reply via email to