Let's say you've got a table with a timestamp
column, and you want to parse that column into two arrays - $date
and $time
.
Do you, personally:
a) query like this DATE(timestamp), TIME(timestamp)
, or perhaps even going as far as HOUR(timestamp), MINUTE(timestamp
b) grab the timestamp
column and parse it out as needed with a loop in PHP
I feel like (a)
is easier... but I know that I don't know anything. And it feels a little naughty to make my query hit the same column 2 or 3 times for output...
Is there a best-practice for this?