Posted by Rik on 01/21/07 15:23
Paul Lautman wrote:
> Dale wrote:
>> A table has a field containing the date and time. Example 2006-2-20
>> 08:11:44.123...field name is DateInitiated. I can extract the month,
>> day and year by using Day(DateInitiated), Month(DateInitiated),
>> Year(DateInitiated). How would the time be extracted for hours,
>> minutes and seconds?
>> Thanks!
>
> Would you believe HOUR() MINUTE() SECOND, or is that too obvious!
That would be the preferred way to handle it at the db side indeed.
If you're doing different things with the date it might be more efficient
to do a date_parse
<http://nl3.php.net/date_parse> at the PHP side of things.
--
Rik Wasmus
[Back to original message]
|