I have a date that is currently formatted as ‘y.m.d’ and I need it formatted as ‘D, M d, Y’. I’ve tried everything I can think of, but it always seems to get confused. Usually, a date that is listed as ‘11.11.27’ comes out as ‘Wed, Dec 31, 1969’ somehow… Any thoughts as to why that happens (really? 1969??) or how to properly perform this conversion would be greatly appreciated.
Share
You can use the
DateTime::createFromFormat()method.For example: