Fixing date bug for mysql