Jump to content

calculation using timestamp


langenf

Recommended Posts

Iam attempting to display a prompt to the users. users have to see how many days left

till they complete 1 year of membership, so that they can subscribe again.$tiArray['joiningDate'] looks id from the database and looks like an unixtimestamp.

Code  gives bizzare values. Please say why?

$ayearafter=(365 * 24 * 60 * 60)+$tiArray['joiningDate'];
echo floor (($yearafter-$tiArray['JoiningDate'])/( 60 * 60 * 24) ),"days left till completion of 1 year","<br>";

Link to comment
https://forums.phpfreaks.com/topic/199515-calculation-using-timestamp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.