我有以下代码:

$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

10-07 16:53