Zepo. Posted November 23, 2007 Share Posted November 23, 2007 Ok i have this code. The first if works fine, but the second one generates some crazy large number, and i dont know why. Both of the incoming dates / time are the same format.. so i dont know why it would do that. if($mem[edited] == 000000000000){ $upjoin="Not Updated Yet"; $_joined = strtotime($joined); $time = time(); $diff = $time - $_joined; $diff = $diff - '60'; $joined = date("F j, Y", $_joined); }else{ $upjoin="$edited"; $_edited = strtotime($edited); $time = time(); $diff = $time - $_edited; $diff = $diff - '60'; $edited = date("F j, Y", $_edited); } Quote Link to comment Share on other sites More sharing options...
toplay Posted November 23, 2007 Share Posted November 23, 2007 I'm not sure what you're trying to do. But one thing wrong is putting 60 in quotes. If you're trying to subtract a minute (60 seconds), then don't put it in quotes. Example: <?php // set $joined // set $edited $time = time(); if (0 == $mem['edited']) { $upjoin = 'Not Updated Yet'; $_joined = strtotime($joined); $diff = $time - $_joined; $diff = $diff - 60; $joined = date('F j, Y', $_joined); } else { $upjoin = $edited; $_edited = strtotime($edited); $diff = $time - $_edited; $diff = $diff - 60; $edited = date('F j, Y', $_edited); } ?> Quote Link to comment Share on other sites More sharing options...
Zepo. Posted November 23, 2007 Author Share Posted November 23, 2007 Im trying to find the difference in time in seconds between the time now and $joined or $edited. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.