Any one got a function to like strtotime()
but the takes the format as input?
For example I need to convert yyyymmdd
to a timestamp, or perhaps yyyyddmm
. So I would like to specify the format used. Also Im on Windows so strptime()
isn't an option.
PHP 5's DateTime
class has the createFromFormat
method which does what you need.
However, it requires PHP 5.3 so it's not always an option (yet).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With