I’m trying to modify a part of Joomla 1.0 setup running on PHP 5.1.6 and I’m having problem with strftime() function. In the code I’m calling:
print strftime("%d-%m-%y", '1304184490') . "\n";
which works in a separate .php file just fine. When it’s part of the joomla code, the script stops execution exactly on that line. I do not get any message in error log (got error_reporting set to E_ALL), no exception is generated, script just stops on that line (verified with print "foo\n" before and after).
What can be the cause of this? I’m not sure about the whole host configuration since it’s some shared hosting account.
strftimerelies on the underlying C library to perform the formatting. The manual warns:Now, your format string is pretty darn elementary, so there’s no real reason that there should be a failure here.
Honestly, your best bet might be using the PHP-native function
dateinstead ofstrftime, asdatedoesn’t rely on a C library call. The equivalent call would be: