-1

I need convert month Name to month number and datetime to date date come from sql 1/oct/2013 0:00 need to convert 1/10/2013 how? Very Thanks

mohammad89
  • 45
  • 1
  • 10

1 Answers1

0

Showing how to convert dates from one format to another is duplicated many times here on SO

$date = DateTime::CreateFromFormat('j/M/Y', '1/oct/2013');
echo $date->format('d/m/Y');

EDIT

If you absolutely can't update from a version of PHP that has been end of life since 6th January 2011, then you can convert your format to a slightly more regular format that will be recognised by strtotime()

$date = strtotime(str_replace('/','-','1/oct/2013'));
echo date('Y-m-d', $date), PHP_EOL;

But I'd strongly recommend updating your version of PHP.... or at least telling people what version you're running when you ask questions (because it makes a lot of difference to the answers you'll get)

Mark Baker
  • 209,507
  • 32
  • 346
  • 385