Jump to content

dates and some math


villain222

Recommended Posts

I'm trying to make a script to check a files date time and if its under so many seconds long the page will refresh.  here is what I've got.  I've been testing the output of the date() functions but when i do the math all i get is a 0.  where did i go wrong? is it just i can't do math with dates?  Thanks in advanced.

<html><head>
<meta http-Equiv="Cache-Control" Content="no-cache">
<meta http-Equiv="Pragma" Content="no-cache">
<meta http-Equiv="Expires" Content="0">
<? 
$proFile = "profilePics/profile.jpg";
//if ( date ("m d Y H:i:s.") - date ("m d Y H:i:s.", filemtime($proFile)) <= 00 00 0000 00:00:04 ){ //this is where the magic should happen.
//echo "<meta http-equiv="refresh" content='4'>"; }
?>
</head>
<?
echo date ("m d Y H:i:s.");
echo "<br>";
echo date ("m d Y H:i:s.", filemtime($proFile));
echo "<br>";
echo  date ("m d Y H:i:s.") - date ("m d Y H:i:s.", filemtime($proFile)); //only outputs 0

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.