Crunch Posted December 20, 2007 Share Posted December 20, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/82515-solved-echo-date-filemtime-add-an-hour-to-time-displayed/ Share on other sites More sharing options...
littledragon Posted December 20, 2007 Share Posted December 20, 2007 <?php echo date('M j, Y G:i', filemtime('2.jpg')+3600); ?> Quote Link to comment https://forums.phpfreaks.com/topic/82515-solved-echo-date-filemtime-add-an-hour-to-time-displayed/#findComment-419443 Share on other sites More sharing options...
littledragon Posted December 20, 2007 Share Posted December 20, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/82515-solved-echo-date-filemtime-add-an-hour-to-time-displayed/#findComment-419448 Share on other sites More sharing options...
Crunch Posted December 20, 2007 Author Share Posted December 20, 2007 Thanks littledragon, For the last 24 hours I read I searched and I copied trying a number of things but could not get my head round it. Never tried between the two )) . Thanks Crunch Quote Link to comment https://forums.phpfreaks.com/topic/82515-solved-echo-date-filemtime-add-an-hour-to-time-displayed/#findComment-419486 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.