Jump to content

XIRR Function and mktime using MySQL


gspica

Recommended Posts

I am using a XIRR function I found on the web. The imputs to the function is:

 

XIRR($values, $dates, 0.1) . "\n";

 

this example code has the following as the $dates array

 

$dates = array(mktime(00,00,00,03,31,2003),mktime(00,00,00,05,20,2003),mktime(00,00,00,05,20,2003),mktime(00,00,00,05,20,2003),mktime(00,00,00,05,27,2003),);

 

This works properly.

 

In my code I am pulling the dates from a mysql date_time formatted column on windows and storing them in an array:

 

00,00,00,03,31,2003, 00,00,00,05,20,2003, 00,00,00,05,20,2003, 00,00,00,05,20,2003, 00,00,00,05,27,2003

 

I am confused on how I format this array so that each date get's mktime formatted so that I can pass the array to the function.

 

I have even had the array, called $datesArray formatted so that each date in the array is formatted:

 

mktime(00,00,00,03,31,2003), etc.

 

then I am saying $dates = array($datesArray);

 

but this does not work.

 

Anyone have any ideas?

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/60681-xirr-function-and-mktime-using-mysql/
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.