Unstoppable Domains

Last Updated Code Problem

Spaceship Spaceship
Watch

D@Z

Established Member
Impact
0
I've got this code which shows the date and time the page was last updated on, but I'm having some problems. The time shown is 6 hours behind the time I need (GMT). Here is the code below;

PHP:
<?
$last_modified = filemtime("test.php");
print("Last Updated ");
print(date("l, d F, Y H:i", $last_modified));
?> GMT
For a preview, visit http://www.korntv.co.uk/test.php

Does anyone know how to fix this or know a better code? Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Use gmdate() instead of date().
 
0
•••
Can you tell me how to do this? I'm not that great with PHP, I mainly use free snippet codes.
 
0
•••
Sure, here you go. Just change the line
PHP:
print(date("l, d F, Y H:i", $last_modified));
to
PHP:
print(gmdate("l, d F, Y H:i", $last_modified));
 
0
•••
Great! it works fine. thanks a lot!!
 
Last edited:
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back