i have to say that the decision to make the birthday column for members on the new board type DATE is a very good one. i never knew about all the magic mysql DATE type can do 🙂
but i still love the simplicity of time arithmetic unix timestamp provides.
Wow, thanks for the link! I’ve been working with PHP and built-in dates in mySQL and I kept running into problems :ouch: I can’t wait to give this a try!
heehee.. I tried to tell you! 🙂 I’ve use mysql date too much.. I don’t even know how to revert back to unix timestamp.
actually you can do something like select UNIX_TIMESTAMP(date_column) and it returns the unix timestamp. tho i still don’t see a very convenient way with date type to figure something like how many days it’s from a certain date. in unixstamp, you can just do
($timerightnow - $dateinquestion) / 24 * 3600 = NUM OF DAYS
What I don’t like about having unix timestamps in the database is that it is impossible to read for the human eye. Which means, that when browsing the database with phpMyAdmin it’s really difficult to actually look at the dates. That’s why I more often than not set the type as DATE. 😀
I have started using mysql based dates, times, timestamps instead of doing work with PHP, and my work has became much easier. If you trying to decide if place unix timestamp in the database or mysql native, GO for mysql one, your life will be easier too :biggrin: