I have to use php function date_parse but it is supported for 5.2.. So is there any alternative for function date_parse for php 5.1..
strtotime, possibly combined with getdate, localtime or gmtime
getdate(strtotime("20 Jan 2009"));
strtotime takes a string, and converts it into a unix timestamp, and the other three functions convert a unix timestamp into an array like date_parse.
Try:
getdate(strtotime($datestr))
Note that some keys are slightly different (eg. 'seconds' rather than 'second' and 'mday' rather than 'day') and getdate doesn't include any error information. getdate
also doesn't support fractions of a second.
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