While it's hard to be sure of this since I have no information about the timezone those timestamps were generated in, it would appear these values are simply a unix timestamp converted to milliseconds. So this simply means you need to divide the value by 1000 to convert it back to a normal unix timestamp and from there getting a date value is simple in PHP.
PHP Code:
$exampleTime = 1356877050000; $exampleUnix = $exampleTime / 1000; echo date("d M Y H:i", $exampleUnix);
Assuming the timestamp was generated in GMT+6(give or take 1) then this would be correct.
I should also mention that just based on the additional code you gave, that method would probably not apply to every single value you would have. It appears that the loop running in that code is not only converting the timestamp to milliseconds but it is adding (or in some cases subtracting) a number of time from the value using
Code:
+ (86400000 * ($i-($days/2)));
but since all of this code is out of context and I don't really feel like downloading and digging through a bunch of code I'm never going to use, I'll just say stick with the first part of my post. If it seems to properly convert all of your values then no worries. If it still gives you some incorrect dates you'll have to dig a bit deeper and resolve the issue of when or why the timestamps are being modified.
"Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"
While it's hard to be sure of this since I have no information about the timezone those timestamps were generated in, it would appear these values are simply a unix timestamp converted to milliseconds. So this simply means you need to divide the value by 1000 to convert it back to a normal unix timestamp and from there getting a date value is simple in PHP.
PHP Code:
$exampleTime = 1356877050000;
$exampleUnix = $exampleTime / 1000;
echo date("d M Y H:i", $exampleUnix);
Assuming the timestamp was generated in GMT+6(give or take 1) then this would be correct.
I should also mention that just based on the additional code you gave, that method would probably not apply to every single value you would have. It appears that the loop running in that code is not only converting the timestamp to milliseconds but it is adding (or in some cases subtracting) a number of time from the value using
Code:
+ (86400000 * ($i-($days/2)));
but since all of this code is out of context and I don't really feel like downloading and digging through a bunch of code I'm never going to use, I'll just say stick with the first part of my post. If it seems to properly convert all of your values then no worries. If it still gives you some incorrect dates you'll have to dig a bit deeper and resolve the issue of when or why the timestamps are being modified.
@ Sup3rkirby ,
Really a big thanks for your reply,
echo strtotime('2013-01-13 06:00');
so far, this is time 6 AM, the calendar shows event be at 11.30 ( like +5.30 ) ( this is my timezone india GMT+5.30)
Really big thanks , i wil give friend request here, please accept it
Bookmarks