Write a Ruby program to display the current date and time
Ruby Code:
require 'date' current_time = DateTime.now cdt = current_time.strftime "%d/%m/%Y %H:%M" puts "Current Date and Time: "+cdt
Output:
Current Date and Time: 27/12/2017 10:30
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Ruby Code:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer