Answer the question
In order to leave comments, you need to log in
Why is using a timestamp in a DB to store a date wrong?
Hello. I'm reading the Yii2 documentation and I read the following sentence:
For example, in a database you store customers' birthdays in UNIX timestamp format (which by the way is not good design)...
Answer the question
In order to leave comments, you need to log in
because:
1. datatime is clearer and more understandable than a timestamp
2. datatime allows you to store fractions of a second
3. with a timestamp, you lose many convenient functions for working with date / time
I'll just leave it here
https://habr.com/ru/post/100741/
https://habr.com/ru/post/123461/
https://habr.com/ru/post/61391/
https:// habr.com/ru/post/357704/
https://habr.com/ru/post/273177/
https://habr.com/ru/post/278527/
https://habr.com/ru/post/ 146109/
https://habr.com/ru/company/yandex/blog/463203/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question