date_create_from_format equivalent for PHP 5.2 (or lower)
Posted
by leekelleher
on Stack Overflow
See other posts from Stack Overflow
or by leekelleher
Published on 2010-04-12T10:54:07Z
Indexed on
2010/04/12
11:03 UTC
Read the original article
Hit count: 497
Hi all,
I'm working with PHP 5.3 on my local machine and needed to parse a UK date format (dd/mm/yyyy). I found that strtotime
didn't work with that date format, so I used date_create_from_format
instead - which works great.
Now, my problem is that my staging server is running PHP 5.2, and date_create_from_format
doesn't work on that version. (It's a shared server, and wouldn't have a clue how to upgrade it to PHP 5.3)
So is there a similar function to date_create_from_format
that I can use? Bespoke or PHP native?
Many thanks, - Lee
© Stack Overflow or respective owner