Reputation: 1190
Can someone explain why
echo date("Y-m-d",strtotime("Wednesday, 1 January, 2014"));
returns
2013-01-02
Upvotes: 2
Views: 311
Reputation: 16818
Drop the comma after January:
date_default_timezone_set('America/New_York');
echo date("Y-m-d",strtotime("Wednesday, 1 January 2014"));
strtotime()
while flexible, still has strict standards of formatting.
Upvotes: 1
Reputation: 11830
Give proper format
strtotime("Wednesday, January 1, 2014")
Upvotes: 0