PDA

View Full Version : QDateTime from non-standard timestamp



pdoria
11th April 2008, 10:15
Hi,

This is probably a lame question... :o but:

Given a timestamp that starts from 2007-01-01 00:00:00

How could one extract the correct date/time from it?

For "normal" unix timestamps I use:



dateTime=QDateTime::fromTime_t ( this->timestamp/1000 );
humanDate = dateTime.toString ( "yyyy-MM-dd hh:mm:ss" );


Already thankful for any insight,
Pedro Doria Meunier

wysota
11th April 2008, 10:29
QDateTime::fromString is your friend.

pdoria
11th April 2008, 15:09
Txs Wysota,

That's precisely what I've used! ;)

Kind regards,
Pedro Doria Meunier.