Problem with strtostring() & date()Function
Posted: Mon Jun 25, 2007 9:10 am
feyd | Please use
Thanks & Regards
PKVASAN
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi Forums
I am using date & strtotime function in my codes
I had given input as "12-02-2006" in php ver 5.2.1 the output produced is 12-02-2006 == Sunday 12th of February 2006 12:00:00 AM
With the same input if i test in php ver 4.3.1.1 the output produced is 12-02-2006 == Saturday 29th of July 2017 12:00:00 AM
Can any one help me what is problem here is it my code is mentioned belowCode: Select all
<?
$str = '12-02-2006';
if (($timestamp = strtotime($str)) === false) {
echo "The string ($str) is in valid";
} else {
echo "$str == " . date('l dS \o\f F Y h:i:s A', $timestamp);
}
?>PKVASAN
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]