Jump to content

Date conversion error


jonsamwell

Recommended Posts

Hi,

 

I think i am doing this right but keep getting a weird return value.

 

I'm changing a date format from d/m/y to y/m/d using the DATE() function, see below code.

 

However the date i put in is not the date i get back out??

$start_date = '23/01/2009'; //input

$start_date = date("Y-d-m", strtotime($start_date) );

//output = 2010-01-11

 

Can anyone see what i am doing wrong?

 

Thanks

 

Jon

Link to comment
https://forums.phpfreaks.com/topic/142098-date-conversion-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.