1
I’m trying to return the timestamp of my city.
When I use the instruction ('Y-m-d H:i:s') it returns the right time of my region but I need to return the timestamp of that hour and it seems that with the instruction ('U') I only get the server time and not the timestamp of the hour of my region.
function agora (){
date_default_timezone_set("America/Campo_Grande");
$dftz011 = date_default_timezone_get();
$dtms011 = new DateTime();
return $dtms011->format('U');
}
I’m using this tool to convert the timestamp returned and when I do the conversion always return me the time of the server and not the Timezone of my region.
How to return the timestamp of my region?
Even
echo $dtms011->format('H:i:s');
does not return the right time?– rray
This returns the right time. With ('U') does not return.
– Marcos Vinicius
you want a timestamp with Timezone this?
– rray
Exactly @rray
– Marcos Vinicius
What is the purpose, I found interesting.
– rray
Variable names are funny
– Wallace Maxters