Peter Craig
Peter Craig

Reputation: 7279

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?

Upvotes: 0

Views: 1174

Answers (2)

Rob
Rob

Reputation: 2148

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

Upvotes: 4

Daniel A. White
Daniel A. White

Reputation: 190897

The HTTP headers which returns from get_headers() is pushing out GMT time per the HTTP standard. What is your time zone on your server?

Upvotes: 1

Related Questions