[Qt-interest] how to get datetime as milliseconds ?

Andre Somers andre at familiesomers.nl
Wed Apr 21 11:25:10 CEST 2010


On 21-4-2010 11:09, Meir Yanovich wrote:
> Hello
> i need to return current data+time as mili seconds since ( i guess 
> 1970 is the default .. )
> i have the time_t that returns seconds , is there build in method for 
> milliseconds ?

No. But you can access the current milli seconds through 
QDateTime::time::msecs(). Add that to QDateTime::toTime_t * 1000, and 
you have what you are looking for. Be sure to use a 64 bit integer to 
store the result though.

André




More information about the Qt-interest-old mailing list