I know that this isn't going to solve your problem but a really fast method of using dates and information is to store the time using a unix time stamp. This is an integer value of seconds counting from the time (1970 -1 second).
It will allow you to format dates in a much simpler manner using something like:
<?php date('d-m-Y', $unixTimeStamp); ?>
This method is also much faster when it comes to comparing times.
use the strtotime function in php to parse the date string and then the date function to print it in whatever format you'd like.
I know that this isn't going to solve your problem but a really fast method of using dates and information is to store the time using a unix time stamp. This is an integer value of seconds counting from the time (1970 -1 second).
It will allow you to format dates in a much simpler manner using something like:
This method is also much faster when it comes to comparing times.