1. Home
  2. Computer Science MCQs
  3. MySQL
  4. Which function used to get the current time in mysql?

Added 19 Jan 2024

 Which function used to get the current time in mysql?

  1. getTime()
  2. Time()
  3. NOW() Correct answer
  4. Date()

Correct answer

C. NOW()

11 views

MCQSEXAM

Explanation

NOW() returns the current date and time in MySQL in the format YYYY-MM-DD HH:MM:SS.

Related functions are CURDATE() for the date only and CURTIME() for the time only. DATE() and TIME() exist but extract part of a value you supply, and getTime() is a JavaScript method.

Want more practice? Try the full set of Database Management Systems MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More MySQL MCQs

Practise all MySQL MCQs

Similar MCQs