Code: Select all
<?php
include "database.php";
//mysql code to get unix time stamps
$dateout = 890179200;
//some while statment
echo "Overdue X days";
Echo "you owe $X in fines";
?>
Moderator: General Moderators
Code: Select all
<?php
include "database.php";
//mysql code to get unix time stamps
$dateout = 890179200;
//some while statment
echo "Overdue X days";
Echo "you owe $X in fines";
?>
Probably the simplest and most direct way is to just subtract the unix timestamp for the beginning date from the unix timestamp for Now, which will give you the number of seconds difference, then take the integer or floor() (http://www.w3schools.com/php/func_math_floor.asp) of the result of dividing that number of seconds by whatever interval you want. If it's 14 days, multiply 14 * 24 * 60 * 60 and use that as your divisor. OK?rileychilds wrote:I'm Still Somwhat confused i'm try to figure out how many days it has been since a date off of a unix timestamp (eg. 54823681) and then based on that calculate how many intervals of 14 there have been. I am trying to wirte code for a library software for my school