I have one questions regarding storing date in mysql database. Here is it :
Is it good to store date in INT
(milliseconds) format rather than yyyy-mm-dd hh:mm:ss format?
So for example, at a time of writing question, the datetime is 2016-02-05 12:19:46. Is it good idea to store this datetime in database in INT means millisecond (1446xxxxxxx) format? Will it increase my db performance?
No, it's not good practice to store date in integer format(milliseconds). Because whenever you'll need date from database you've to convert it back into Date Format and it'll affect your application's performance. And When talking about Db's performance it'll be constant as there wouldn't much affect but it'll be a bottle neck for you to retrieve date from database and convert back to date format and represent or use in your application.
But you can do it if you're in really need of it. As i'm unknown to your scenario of application and it's usage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With