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); } Link to comment https://forums.phpfreaks.com/topic/78501-time-questions-yaaayyy/ 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); } ?> Link to comment https://forums.phpfreaks.com/topic/78501-time-questions-yaaayyy/#findComment-397275 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. Link to comment https://forums.phpfreaks.com/topic/78501-time-questions-yaaayyy/#findComment-397276 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.