Jump to content

Expiration Date????


Halisco

Recommended Posts

I have a experation script that works well until i get over approximately "10230" days.  Once i get past that many days the value becomes negative.  Any Ideas why this would happen?

 

Here is my script:

 

$BadDate = (( (strtotime($CertExp)) - (strtotime($todays_date))   ) / 60 / 60 / 24 );
if (($BadDate < 90 AND $BadDate > 0) OR ($BadDate < 0)){
$BadTh="thred";
$BadTd="tdred";
elseif ($BadDate == 0){
$BadTh="thred";
$BadTd="tdred";
}else{
$BadTh="";
$BadTd="";
}

 

 

Link to comment
https://forums.phpfreaks.com/topic/147383-expiration-date/
Share on other sites

Because a UNIX Timestamp has a 2038 limit that makes it unusable for a lot of purposes, like birthdays and dates more than 29 years into the future.

 

Is there a work around I can use to avoid getting this negative number.  I have to use the dates in the database that are later then 2038.

Link to comment
https://forums.phpfreaks.com/topic/147383-expiration-date/#findComment-773623
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.