Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Last Updated Code Problem

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Use gmdate() instead of date().
 
0
Close
Can you tell me how to do this? I'm not that great with PHP, I mainly use free snippet codes.
 
0
Close
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
Close
Great! it works fine. thanks a lot!!
 
Last edited:
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back