php getdate returns date 2 hours off

440 Views Asked by At

I've got a pretty simple question. I send a date as millis created by javascript to a php site and use phps getdate to get information about the date in an associative array. My timezone is GMT+2, but I do not understand why date conversion using milliseconds should have any effect like this. Can someone please explain this to me?

Thanks!

1

There are 1 best solutions below

2
On BEST ANSWER

It sounds like PHP doesn't know what the timezone is supposed to be or the system timezone is not properly set. The simplest fix is to set the timezone you want yourself in the PHP code.