Home / Report Question

Q. How do you get the current date and time in Ruby?
  • A. date = Date.now
  • B. time = Time.now
  • C. datetime = DateTime.now
  • D. now = Date.today

Correct Answer: B