Re: [PHP] convert date from UK to US for strtotime

2004-01-14 Thread Jon Bennett
ok, got it: // converts a UK date (DD-MM-YYY) to a US date (MM-DD-) and vice versa function convertDate ($sDate) { $aDate = split ("/", $sDate); $return = $aDate[1]."/".$aDate[0]."/".$aDate[2]; return $return; } Cheers, Jon jon bennett | [EMAIL PROTECTED] new media creativ

Re: [PHP] convert date from UK to US for strtotime

2004-01-14 Thread php
> What I really need is to re-order the string that a user inputs, say, > 21/04/2004, so that it becomes 04/21/2004 so I can use strtotime. I use preg_match() (http://www.php.net/manual/de/function.preg-match.php): $dateuk = '21/04/2004'; preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $

Re: [PHP] convert date from UK to US for strtotime

2004-01-14 Thread CPT John W. Holmes
From: "Jon Bennett" <[EMAIL PROTECTED]> > I'm trying to re-work this code from the php site > so that my users can input dates in UK > format (dd-mm-) and still use strtotime. > > // from http://uk.php.net/strtotime > > $date=explode("/",trim($records[2])); > $pos

[PHP] convert date from UK to US for strtotime

2004-01-14 Thread Jon Bennett
Hi, I'm trying to re-work this code from the php site so that my users can input dates in UK format (dd-mm-) and still use strtotime. // from http://uk.php.net/strtotime $date=explode("/",trim($records[2])); $posted=strtotime ($date[1]."/".$date[0]."/".$date[2