time_stamp problem


#1

In your documentation sent_timestamp will be received as UNIX timestamp, but I am unable to convert to MYSQL date format to save it in DB.

$timestamp = $_REQUEST[‘sent_timestamp’]; //1416004921458
echo $time_sent = date(‘Y-m-d H:i:s’, $timestamp); it returns as “1927-09-20 21:56:18”

Usually timestamp should be 10 digits why am I receiving 13 characters. Is there any thing I am missing?


#2

timestamp in SMSSync is with milliseconds

This is simple solution for you

echo $time_sent = date(‘Y-m-d H:i:s’, (int) $timestamp /1000);


#3

Hi,

With $time_sent = date(‘Y-m-d H:i:s’, $timestamp); it returns as 2014-05-10 02:51:36
With $time_sent = date(‘Y-m-d H:i:s’, (int) $timestamp /1000); it returns as 1970-01-25 20:31:23

what am I doing wrong?


#4

This is a simple app and this is good for all of us for more click here