<?
$last_modified = filemtime("home.php");
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
is there a way to add a time offset, beauese the server time is different from my home timeI don't know if there's any special way to do it, but since filemtime() returns a UNIX timestamp, you can just add or subtract the amount of time you like. I would guess there are better ways, though.
<?
$hours_difference = -2; // can be negative or positive
$last_modified = filemtime("home.php");
$last_modified += $hours_difference * 60 * 60;
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
There is probably some way to change timezone locally for the script, but I'm not too used to working with that, so why don't you have a look yourself? Maybe it helps.
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.datetime.phpthanks">http://www.php.net/manual/en/ref.datetime.phpthanks</a><!-- m --> man! I will check that out.I got. woohoo!
thanks.
another quick question
<?
$hours_difference = -2; // can be negative or positive
$last_modified = filemtime("home.php");
$last_modified += $hours_difference * 60 * 60;
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
do I have to change anything with this variable?
$last_modified += $hours_difference * 60 * 60;Change what variable? there are two in that statement... But no, I don't think you have to change anything else than
$hours_difference = -2;
to the difference of your choice.. But well, I haven't tried that code.
$last_modified = filemtime("home.php");
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
is there a way to add a time offset, beauese the server time is different from my home timeI don't know if there's any special way to do it, but since filemtime() returns a UNIX timestamp, you can just add or subtract the amount of time you like. I would guess there are better ways, though.
<?
$hours_difference = -2; // can be negative or positive
$last_modified = filemtime("home.php");
$last_modified += $hours_difference * 60 * 60;
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
There is probably some way to change timezone locally for the script, but I'm not too used to working with that, so why don't you have a look yourself? Maybe it helps.
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/ref.datetime.phpthanks">http://www.php.net/manual/en/ref.datetime.phpthanks</a><!-- m --> man! I will check that out.I got. woohoo!
thanks.
another quick question
<?
$hours_difference = -2; // can be negative or positive
$last_modified = filemtime("home.php");
$last_modified += $hours_difference * 60 * 60;
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>
do I have to change anything with this variable?
$last_modified += $hours_difference * 60 * 60;Change what variable? there are two in that statement... But no, I don't think you have to change anything else than
$hours_difference = -2;
to the difference of your choice.. But well, I haven't tried that code.