B
Beemer Biker
I cant seem to get that date into any DateTime to make my calculation
directly by subtracting "01-01-0000" from "now".
After reading this:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11469&objectType=File
I kluged up this routine that works:
// convert date time into that funny matlab serial date time that starts at
jan 1, 0000
private string DT2Matlab(DateTime thisDT)
{
DateTime y1970 = Convert.ToDateTime("JAN-1-1970");
thisDT = thisDT.AddDays(719529);
// supposidly 719529 days from "0 CE" to 1970
TimeSpan ts = thisDT.Subtract(y1970);
return ts.TotalDays.ToString("#.####");
}
Seems there should be a cleaner way to calculate "Days.fraction_of_days"
from "0 CE" all in one swoop? "01-01-0001" gives the wrong answer when
subtracting and the 0000 is a no go.
...thanks for looking..
--
======================================================================
Joseph "Beemer Biker" Stateson
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================
directly by subtracting "01-01-0000" from "now".
After reading this:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11469&objectType=File
I kluged up this routine that works:
// convert date time into that funny matlab serial date time that starts at
jan 1, 0000
private string DT2Matlab(DateTime thisDT)
{
DateTime y1970 = Convert.ToDateTime("JAN-1-1970");
thisDT = thisDT.AddDays(719529);
// supposidly 719529 days from "0 CE" to 1970
TimeSpan ts = thisDT.Subtract(y1970);
return ts.TotalDays.ToString("#.####");
}
Seems there should be a cleaner way to calculate "Days.fraction_of_days"
from "0 CE" all in one swoop? "01-01-0001" gives the wrong answer when
subtracting and the 0000 is a no go.
...thanks for looking..
--
======================================================================
Joseph "Beemer Biker" Stateson
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================