Goofing up date and time calculations.May 2, 2006No matter how many programming languages I learn (I know quite a few), one thing I will never master is date and time calculations. In times past, I have even called my self the april fool of programming. Name calling isn't the solution to the problem. There isn't a solution! I realised just how bad I am at date and time calculations when testing Log Mine, Log Mine very embarrasingly shows 31 days for the month of February. I have used a very tedious calculation to derive the number of days in a month. Turns out all I need to do is to call the date function with the time stamp and the parameter 't'.
$days = date('t',$summary->currentDate[0]);
Hopefully I will remember this the next time I have to deal with dates and times.
Posted by raditha at May 2, 2006 10:03 AM
|
|



