0

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?

Peter Craig
  • 7,101
  • 19
  • 59
  • 74
  • What are the locale and timezone settings for your server? – jason Aug 14 '09 at 03:51
  • 3
    I ask, because they probably are the same time. PHP is giving your UTC, while apache is probably giving you your time adjusted for your timezone. Like, 0800 UTC == 0300 EST (for example). – jason Aug 14 '09 at 03:56

2 Answers2

4

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

Rob
  • 2,148
  • 13
  • 17
1

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?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445