将选定的时间戳(带工作日)更改为 Fr、Mo 等
Changing the selected timestamp (with weekday) to Fr, Mo etc
我有以下代码:
$meetings= $db->query("SELECT title, DATE_FORMAT(meetings.time, '%W, %d.%c.%Y - %H:%i') AS time2 FROM meetings");
while ($row = $meetings->fetch_object()) {
echo'
<tr>
<td class="td_contentbar">'.$row ->title.'</td>
<td class="td_contentbar">'.$row ->time2.'</td>
</tr>
';
}
我想得到一个显示会议时间的输出,但时间必须像这样输出:
Fr, 06.07.2015 - 20:52(含 Mo、Fr 等...)
我该如何解决这个问题?
试试这个查询:
SELECT CONCAT(LEFT(DATE_FORMAT(meetings.time, '%W'),2), DATE_FORMAT(meetings.time, ', %d.%c.%Y - %H:%i')) AS time FROM meetings
我有以下代码:
$meetings= $db->query("SELECT title, DATE_FORMAT(meetings.time, '%W, %d.%c.%Y - %H:%i') AS time2 FROM meetings");
while ($row = $meetings->fetch_object()) {
echo'
<tr>
<td class="td_contentbar">'.$row ->title.'</td>
<td class="td_contentbar">'.$row ->time2.'</td>
</tr>
';
}
我想得到一个显示会议时间的输出,但时间必须像这样输出: Fr, 06.07.2015 - 20:52(含 Mo、Fr 等...)
我该如何解决这个问题?
试试这个查询:
SELECT CONCAT(LEFT(DATE_FORMAT(meetings.time, '%W'),2), DATE_FORMAT(meetings.time, ', %d.%c.%Y - %H:%i')) AS time FROM meetings