Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
MySQL
« Previous
Next »
Which of the following ways are the correct way to get the current date?
Options
- SELECT CURTIME();
- SELECT CURDATE();
- SELECT CURRENT_TIME();
- All of the above
CORRECT ANSWER : All of the above
Discussion Board
SELECT CURDATE(); Gives Current Date
SELECT CURTIME(); Gives Current Time
E.g. CURTIME()
08:27:33
SELECT CURDATE(); Gives Current Date
CURDATE()
2021-03-16
SELECT CURRENT_TIME(); Gives Current Time
CURRENT_TIME()
08:29:48
SELECT NOW(); Gives Current Date and Time
NOW()
2021-03-16 08:30:21
Jagadish 03-16-2021 04:32 AM
Wrong Answer
The correct answer CURDATE is same as CURRENT_DATE()/DATE() and the rest of the function will provide time only.
Chandra Shekhar Paatni 04-3-2017 01:32 AM
wrong answer
SELECT CURTIME(); 12:24:26
SELECT CURDATE(); 2016-04-21
SELECT CURRENT_TIME(); 12:25:19
SELECT NOW(); 2016-04-21 12:26:03
So you see for yourself. Only NOW() and CURDATE() return a DATE. The test return TIME
CoR 04-21-2016 06:28 AM
wrong ans.
SELECT CURDATE(); only return date others returns time.
bapi 04-15-2016 03:56 AM
Current Date
Yep answer is All above.
Fairuz sulaiman 09-23-2014 11:17 PM
to get current date you have to use curdate()
curtime & current_time return only the time part.
John Ashmead 01-28-2014 02:40 PM
Wrong answer +1
@Sandro Alves Peres +1
poulks 10-22-2013 05:51 AM
Wrong Answer
The correct answer is not "All of above" as it says.. Correct is "SELECT CURDATE()", because the other options return only TIME not current DATE
Sandro Alves Peres 09-2-2013 07:19 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
PHP (39)
DHTML (10)
CSS (21)
MySQL (20)
VLSI (9)
XML (28)
UML (11)
HTML (19)
Fedora (61)
HTML5 (60)
Android (100)
Advertisement
▲