I have a date format: $date = "Sun May 09 20:07:50 +0000 2010";
I have to convert it into 09-05-2010 this format. I am getting it when i echo like this;
echo date("d-m-Y", strtotime($date ));
But problem is when i try to echo it in loop it gives me answer as 31-12-1969
I am using loop as
I have to convert it into 09-05-2010 this format. I am getting it when i echo like this;
echo date("d-m-Y", strtotime($date ));
But problem is when i try to echo it in loop it gives me answer as 31-12-1969
I am using loop as
Code:
foreach($users as $k=>$v)
{
if($k == 'test')
{
foreach ($v as $k1=>$v1)
{
echo $date1 = date("d-m-Y", strtotime($date));
}
}
}
Comment