Jump to content

[SOLVED] echo date filemtime - ? add an hour to time displayed.


Crunch

Recommended Posts

Hi,

I have 12 images being updated via ftp every hour from my webcam to my site.

The file names stay the same, are just replaced in sequence.

The server must be in Central Time and I am Eastern Time.

The file reports as 7am but I would like to show the local time which is 8am.

How do I add one hour to the code to achieve this please.

Currently using this code for each image to show time below the image.

        
<td>
<div align="center">
<a href="2.jpg" target="popup" onClick="wopen('2.jpg', 'popup', 640, 480); return false;"><img src="2.jpg" width="160" height="120" border="0"></a><br>
<?php echo date('M j, Y G:i', filemtime('2.jpg')); ?>
<br><br>
</div>
</td>

 

Thanks Crunch

PS have a look at the php manual for date functions, it can get a little confusing, but I can do date_default_timezone_set('Europe/London') on my server which is somewhere near Salt Lake US and the time comes out fine.  Your equivalent to 'Europe/London' will be in there somewhere. 

 

http://br.php.net/manual/en/function.date-default-timezone-set.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.