fromMSecsSinceEpoch does not work as expected
Hi,
I have problems converting from timestamp to QDateTime. This is the code:
Code:
QDate some_d
=somedate.
date();
qWarning() << "some_d=" << some_d.toString();
and this is what I get on the console:
Code:
some_d= "Mon Jan 5 1970"
The date I used is of 23 Jan of this year, as you can see below
Code:
-bash-3.00$ cat /tmp/test.php
<?
$ts=1422021168;
echo date("Y-m-d H:i",$ts);
?>
-bash-3.00$ /usr/bin/php -f /tmp/test.php
2015-01-23 07:52
-bash-3.00$
What I am missing?
TIA
Re: fromMSecsSinceEpoch does not work as expected
Since multiply two int numbers result is an int and overflow. Change line to this :
Re: fromMSecsSinceEpoch does not work as expected
Quote:
Originally Posted by
Lesiok
Since multiply two int numbers result is an int and overflow. Change line to this :
wow! would never think that's the cause. Thanks a lot!
Re: fromMSecsSinceEpoch does not work as expected
These are the basics of programming. Maybe first explore better C++.