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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.