Jump to content

year 2038 issue


jwwceo

Recommended Posts

Hello,

 

I am making a website for a bond company, which has 30 year bonds. This puts the call dates at beyond 2038. None of my strtotime functions are working. Any ideas how to work around this.

 

I think I am just storing the time as a varchar string in the DB.

 

Can I just manually find what the strtotime value would be using sometimes like 30 times  31 556 926 seconds?? this doesnt account for leap years, etc I dont think?

 

Any ideas??

 

James

Link to comment
https://forums.phpfreaks.com/topic/202754-year-2038-issue/
Share on other sites

So how would I use MySQL to do this work? Would I query the DB in every iteration of the loop. I'm not sure what I would even be querying.

 

Heres the basic structure I have in place now:

 

$start_date = strtotime($row['int_accrual_date']);
$end_date = strtotime($row['maturity_date']);

while ($start_date <= $end_date){


#### DO SOME STUFF ###

$start_date = strtotime('+1 month', $start_date);



}

Link to comment
https://forums.phpfreaks.com/topic/202754-year-2038-issue/#findComment-1062806
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.