FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » local time, not server time
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: local time, not server time [message #32952 is a reply to message #32884] Sun, 06 August 2006 19:05 Go to previous messageGo to previous message
kenjb is currently offline  kenjb   United States
Messages: 67
Registered: September 2004
Karma:
Member
What report?

<?php
$hourdiff = "0";
$timeadjust = ($hourdiff * 60 * 60);
$last_modified = filemtime("index.php");
echo"Last Modified: ";
$adjtime =date("l F j, Y g:ia", $last_modified + $timeadjust);
print ("$adjtime");
echo" EDT";
?>


The above takes the time a file was last changed and if needed, can modify the time by adding a number to "$hourdiff". Just take your local time as you have it listed and add the new vaiable to the $hourdiff in the &adjtime calculation.

That make sense?

lets see:

<?php
$hourdiff = "-1";
$timeadjust = ($hourdiff * 60 * 60);
$adjtime =date ("g:ia", + $timeadjust);
print ("$adjtime");
?>


With the above whatever the server time is, the display time now will be -1 hour.

That help?


kenjb

[Updated on: Sun, 06 August 2006 19:08]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Forced downgrade of PHP
Next Topic: php/sql design help
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 16:15:22 GMT 2024

Total time taken to generate the page: 0.03977 seconds