Hi,
I have problems converting from timestamp to QDateTime. This is the code:
QDate some_d
=somedate.
date();
qWarning() << "some_d=" << some_d.toString();
QDateTime somedate=QDateTime::fromMSecsSinceEpoch(1000*1422021168);
QDate some_d=somedate.date();
qWarning() << "some_d=" << some_d.toString();
To copy to clipboard, switch view to plain text mode
and this is what I get on the console:
some_d= "Mon Jan 5 1970"
some_d= "Mon Jan 5 1970"
To copy to clipboard, switch view to plain text mode
The date I used is of 23 Jan of this year, as you can see below
-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$
-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$
To copy to clipboard, switch view to plain text mode
What I am missing?
TIA
Bookmarks