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() .

When integrating with C++, note that any QDate or QDateTime passed into QML from 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 基本类型 .