Database Reference
In-Depth Information
Figure 11.1
SELECT NOW().
SELECT id, datecreated
FROM log
WHERE ID= 6
Figure 11.2 shows the results, yours will show a different date and time!
CURRENT_DATE
CURRENT_DATE gives you the system date for today. It differs from NOW() in that it does
not require the brackets and only outputs the date.You can use the following to find the cur-
rent date quickly:
SELECT
CURRENT_DATE
Figure 11.3 shows the way that CURRENT_DATE is output in a query.
CURRENT_TIME
CURRENT_TIME returns the system time. Again it differs from NOW() in that it does not
require the brackets and only outputs the time. You can use the following to find the current
time quickly:
SELECT
CURRENT_TIME
Figure 11.2
An inserted NOW().
Search WWH ::




Custom Search