langenf Posted April 23, 2010 Share Posted April 23, 2010 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 More sharing options...
teamatomic Posted April 23, 2010 Share Posted April 23, 2010 ayearafter or yearafter, which do you want to use? HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/199515-calculation-using-timestamp/#findComment-1047165 Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 Aside from variable complications, wouldn't that always generate the value 365? Link to comment https://forums.phpfreaks.com/topic/199515-calculation-using-timestamp/#findComment-1047166 Share on other sites More sharing options...
langenf Posted April 27, 2010 Author Share Posted April 27, 2010 sorry for the typo, it is actually yearafter. It still doesn't work i don't know why Link to comment https://forums.phpfreaks.com/topic/199515-calculation-using-timestamp/#findComment-1049254 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.