So I'm trying to get today's date and time and timezone etc. in php. In other questions on stackoverflow I ended up with this: echo date('D M d Y H:i:s O')
and it returns this: Tue May 15 2018 23:08:48 +0200
.
But when I use Date()
function in JS it returns this: Tue May 15 2018 23:12:55 GMT+0200 (Central Europe Daylight Time)
.
And this is the problem how can I get same result in PHP as in JS ?? I have no idea, maybe I can just add there (Central Europe Daylight Time)
this as text, but it's weird. Can you help me out ?
NOTE: And default timezone is set in PHP. Just like that: date_default_timezone_set("Europe/Prague");
This is that adding text version:
$today = date('D M d Y H:i:s O')." (Central Europe Daylight Time)";
echo $today;
And it returns Tue May 15 2018 23:25:09 +0200 (Central Europe Daylight Time)
this.