Why does strftime () on windows return false? (I do not use% e)

Here is my code:

var_dump(strftime("%m-%d-%Y %l:%M:%S", time()));
echo "<br />";
var_dump(strftime("%Y-%d-%m %H:%M:%S", time()));

The first line returns false, and the third returns the expected line '2012-10-09 23:03:18' (length = 19)

Why does the first line return false?

I am running windows 7x64 and wamp with pretty standard settings.

+5
source share
2 answers

If the first line does not work, and the second does, then the reason is obviously related to %l

var_dump(strftime("%l", time()));

Makes mistakes in windows.

Reading the strftime tutorial ...

C, PHP strftime(). , , , Unix. , % e,% T,% R ,% D (, , ), 1 1970 . Windows, Linux . Windows "MSDN".

%l , .

+5

WAMP, %l . %e, %#d, %#I 0, . , :

var_dump(strftime("%m-%d-%Y %#I:%M:%S", time()));

, linux, #I .

+2

All Articles