我有一个这样的日期:
3/6/2014 7:20
Run Code Online (Sandbox Code Playgroud)
我希望它被格式化为
03/06/2014 07:20
Run Code Online (Sandbox Code Playgroud)
这样做的最佳做法是什么?
就像:)一样简单
date("m/d/Y h:i");
Run Code Online (Sandbox Code Playgroud)
请参阅手册以查看这些值代表的含义.嗯,让我把这些带到这里.
m = Numeric representation of a month, with leading zeros
d = Day of the month, 2 digits with leading zeros
Y = A full numeric representation of a year, 4 digits
h = 12-hour format of an hour with leading zeros
i = Minutes with leading zeros
Run Code Online (Sandbox Code Playgroud)