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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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