给定日期-时间-字符串的工作日名称


Name of Weekday of given date-time-string

$dateTime = '2011-10-25 14:08:32';

我想在PHP中显示$dateTime的日期。为例。2011-10-25是星期二

使用PHP的date()函数

date("l", strtotime($datetime));
$day = date("l", strtotime($dateTime));

或者,您可以使用strftime():

$day = strftime("%A", strtotime($dateTime));

PHP函数中的strftime()等价于C、Perl、GAWK、SQLite等中的同名函数