Search code examples
phpapachelast-modifiedget-headers

Why is the PHP get_headers() Last-Modified different from the apache file info


I have an Apache directory listing of files on a remote server (in Australia/Adelaide +930) I have no control over. This server shows the correct last modified date of a file as: 14-Aug-2009 09:41

I have a PHP script on my US server to check the date of the remote file. get_headers()['Last-Modified'] returns: Fri, 14 Aug 2009 00:11:11 GMT

How do I get my PHP script to output the same as Apache?


Solution

  • You're in Adelaide, Australia, which is GMT +9:30. get_headers() is giving you GMT time. apache is giving you local time.