IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

date QML Value Type

a date value.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Detailed Description

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

To create a date value, specify it as a "YYYY-MM-DDThh:mm:ss.zzzZ" string. (The T is literal, YYYY is a full year number, MM and DD are month and day numbers, hh, mm and ss are hours, minutes and seconds, with .zzz as milliseconds and Z as time-zone offset. The T and following time are optional. If they are omitted, the date is handled as the start of UTC's day, which falls on other dates in some time-zones. When T is included, the :ss.zzz or just .zzz part can be omitted. With or without those, the zone offset can be omitted, in which case local time is used.) For example:

 
Sélectionnez
MyDatePicker { minDate: "2000-01-01 0:0"; maxDate: "2020-12-31 23:59" }

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 value passed into QML from C++ is automatically converted into a date value, and vice-versa. Note, however, that converting a QDate will result in UTC's start of the day, which falls on a different date in some other time-zones. It is usually more robust to convert the QDate via a QDateTime explicitly, specifying local-time or a relevant time-zone and selecting a time of day (such as noon) that reliably exists (daylight-savings transitions skip an hour, near one end or the other of a day).

This value type is provided by the QML language. It can be implicitly converted to a Date object.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+