I'm working with an xml file in php and my concern is on the date field. The xml outputs the date likes this ..
<EndTime>1427295540000</EndTime>
I'm having a hard time identifying the format of this time, and how to convert it to something like 2015-05-11 12:00:00
. Please help
$input = 1427295540000 / 1000; //because we wants seconds but got miliseconds then divide by 1000
echo date("Y-m-d H:i:s", $input);
you can divide value of end time by 1000, because we wants seconds in php and then pass it as second argument to date
function with proper format as frist argument
PHP has a built in date function for this purpose
$time = date("h:i:sa"); //for time in hour mins and second format
$date = date("d-m-Y"); // for date in day month year format
Read more at php.net or w3schools
for getting time in your time zone use php function date_default_timezone_set("Your time zone");