date QML Basic Type

a date value.

The date type refers to a date value, including the time of the day.

要創建 date value, specify it as a "YYYY-MM-DD" string:

MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
					

To read a date value returned from a C++ extension class, use Qt.formatDate() and Qt.formatDateTime() .

集成 C++ 時,注意任何 QDate or QDateTime 傳入 QML 來自 C++ is automatically converted into a date value, and vice-versa.

This basic type is provided by the QML language. It can be implicitly converted to a Date 對象。

另請參閱 QML Date object and QML 基本類型 .