if date is 0000-00-00 , it is displayed as -0001-11-30. phpMyAdmin looks fine

if date is 0000-00-00 , it is displayed as -0001-11-30. phpMyAdmin looks fine

rbyrnsrbyrns Posts: 36Questions: 9Answers: 0

Anyone have a clue why this might be happening? I am guilty of importing the dates in as varchar then just changing the field type to date(10). Might be a mysql thing.

This question has an accepted answers - jump to answer

Answers

  • rbyrnsrbyrns Posts: 36Questions: 9Answers: 0

    I fixed it by "update set datefield = null where datefield = '0000-00-00'. No idea though why datafields showed it wrong, while phpMyAdmin showed it right.

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    Sounds like a timezone conversion possibly. phpMyAdmin has a whole load of code for normalising connections, which might be why it shows a different result.

    Allan

This discussion has been closed.