如何从moodle数据库以日期格式输出列?

如何从moodle数据库以日期格式输出列?,moodle,Moodle,我想从moodle数据库中以日期格式显示列日期: 查看代码: $table = new html_table(); $table->head = array('Date','Time', 'A' , 'B', 'C','D', 'E', 'F'); 对于如何以日期格式显示日期列的任何参考或帮助,我将不胜感激。使用userdate()它将在用户区域设置中显示日期 userdate($scheduledatet) 编辑:您还可以使用get\u string() 这些是/lang/en/la

我想从moodle数据库中以日期格式显示列日期:

查看代码:

$table = new html_table();
$table->head = array('Date','Time', 'A' , 'B', 'C','D', 'E', 'F');
对于如何以日期格式显示日期列的任何参考或帮助,我将不胜感激。

使用
userdate()
它将在用户区域设置中显示日期

userdate($scheduledatet)
编辑:您还可以使用
get\u string()

这些是/lang/en/langconfig.php中的英文格式

$string['strftimedate'] = '%d %B %Y';
$string['strftimedatefullshort'] = '%d/%m/%y';
$string['strftimedateshort'] = '%d %B';
$string['strftimedatetime'] = '%d %B %Y, %I:%M %p';
$string['strftimedatetimeshort'] = '%d/%m/%y, %H:%M';
$string['strftimedaydate'] = '%A, %d %B %Y';
$string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p';
$string['strftimedayshort'] = '%A, %d %B';
$string['strftimedaytime'] = '%a, %H:%M';
$string['strftimemonthyear'] = '%B %Y';
$string['strftimerecent'] = '%d %b, %H:%M';
$string['strftimerecentfull'] = '%a, %d %b %Y, %I:%M %p';
$string['strftimetime'] = '%I:%M %p';
没问题:)我刚刚更新了日期/时间格式的答案
$string['strftimedate'] = '%d %B %Y';
$string['strftimedatefullshort'] = '%d/%m/%y';
$string['strftimedateshort'] = '%d %B';
$string['strftimedatetime'] = '%d %B %Y, %I:%M %p';
$string['strftimedatetimeshort'] = '%d/%m/%y, %H:%M';
$string['strftimedaydate'] = '%A, %d %B %Y';
$string['strftimedaydatetime'] = '%A, %d %B %Y, %I:%M %p';
$string['strftimedayshort'] = '%A, %d %B';
$string['strftimedaytime'] = '%a, %H:%M';
$string['strftimemonthyear'] = '%B %Y';
$string['strftimerecent'] = '%d %b, %H:%M';
$string['strftimerecentfull'] = '%a, %d %b %Y, %I:%M %p';
$string['strftimetime'] = '%I:%M %p';