Hello i finding average of array of dates. while running the code i am getting error as--> ArgumentError: invalid date in ROR
This is how my code looks like ---->
arrays = [Tue, 08 Dec 2020 20:21:03 IST +05:30, Tue, 08 Dec 2020 20:21:05 IST +05:30] # this is the date format i am getting from the database
i = 0
arrays.each do |array| # arrays get value as array of dates
array1[i] = Date.parse(array.strftime('%Y-%d-%m')) # i am getting the error in this line
i = i+1
end
Aucun commentaire:
Enregistrer un commentaire