-2

Hi I know the question most likely has been asked before - but have spent 20minutes trying to find it, and can't

Here is my issue I have tried to convert 2014-06-19T01:11:09-07:00 to look like this 19-06-2014 with date()

however it gives me the wrong date my 1901-01-01

so I am wondering what is the correct way to convert these dates.

RussellHarrower
  • 6,339
  • 20
  • 90
  • 182

1 Answers1

1

Most likely it didn't work on your feeding the date() function with the values of 2014-06-19T01:11:09-07:00 which isn't in timestamp. date() requires the second paramater to be in timstamp. Consider this example:

echo date('d-m-Y', strtotime('2014-06-19T01:11:09-07:00'));
// 19-06-2014
// dd-mm-yyyy  
user1978142
  • 7,965
  • 3
  • 16
  • 20