xa4 Posted December 10, 2009 Share Posted December 10, 2009 Greetings! this is my first post, thank you in advance for your replies. Well, the title says it all, is there an equivalent of the function strptime() for php4 ? I want to parse a timestamp like this one: 2009-12-10T13:11:10Z Thank you very much and best regards, Xavier Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/ Share on other sites More sharing options...
cags Posted December 10, 2009 Share Posted December 10, 2009 Is it always going to be that exact format? You could write a Regular Expression to do the job without too much trouble. Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-974751 Share on other sites More sharing options...
Mchl Posted December 10, 2009 Share Posted December 10, 2009 strtotime parses this format into unix timestamp. From there on, you can do whatever you like with it. Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-974757 Share on other sites More sharing options...
Daniel0 Posted December 10, 2009 Share Posted December 10, 2009 Why bother with PHP4 anyway? PHP4 end of life was announced in July 2007. It doesn't even get security patches anymore. Upgrade! http://www.php.net/archive/2007.php#2007-07-13-1 Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-974780 Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2009 Share Posted December 10, 2009 I'll echo what Daniel0 just stated. The end of life of php4 was two years ago this month. You should be spending your time planning how you are going to upgrade to php5 and finding out the method your web host has provided for you to select php5 on their servers. Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-974789 Share on other sites More sharing options...
Mchl Posted December 10, 2009 Share Posted December 10, 2009 Or finding a new webhost. Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-974808 Share on other sites More sharing options...
xa4 Posted December 10, 2009 Author Share Posted December 10, 2009 Guys thank you very much for the prompt responses !! Yes I should change my host but it is one of the cheapest I have found... I will do as you suggested, thank's ! Best, Xavier Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-974823 Share on other sites More sharing options...
xa4 Posted December 16, 2009 Author Share Posted December 16, 2009 For those who are interested.. I tried to use the strtotime() function but it doesn't work (returns -1) ex: strtotime(2009-12-16T10:57:18Z); However, it works if I remove the Z. ex: strtotime(2009-12-16T10:57:18); best, Xavier Quote Link to comment https://forums.phpfreaks.com/topic/184641-strptime-equivalent-for-php4/#findComment-978477 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.