View Single Post
Posts: 10 | Thanked: 0 times | Joined on Jan 2014
#1
Hi,

I am very new to Qt and just got stuck at a probably very simple problem. The XML file I got contains a date formatted as unix timestamp. How do I get this timestamp into a string?

This is XmlRole:
Code:
XmlRole { name: "date"; query: "date/number()" }
And this is my approach to format it:
Code:
Label {
                id: labelArt
                text: Qt.formatDateTime(Date(model.datum),"dd.mm.YY - hh:mm" ) +"  --  "
}
The result is just the two dashes. Probably the "Date(model.datum)" is not the correct way to do it but I was not able to find how to do in any documentation.

Thanks!

Last edited by No.User; 2014-01-25 at 10:08.