1.方法1
import QtQuick 2.0 Timer { interval: 500; running: true; repeat: true; onTriggered: time.text = Qt.formatDateTime(new Date(), "dddd\nyyyy-MM-dd\n-MMM-\nhh-mm-ss") // 星期 年份 月份 号 大月份 } Text { id: time; color: "#fff"; font.pointSize: 14; anchors
import QtQuick 2.0 Timer { interval: 500; running: true; repeat: true; onTriggered: time.text = Qt.formatDateTime(new Date(), "dddd\nyyyy-MM-dd\n-MMM-\nhh-mm-ss") // 星期 年份 月份 号 大月份 } Text { id: time; color: "#fff"; font.pointSize: 14; anchors