The date column in spreadsheet is formatted as 'mm/dd/yyyy'
But when I read the above column via spreadsheet the format is different than the above format.
My code is as follows:
require 'spreadsheet'
Spreadsheet.client_encoding = 'UTF-8'
book = Spreadsheet.open params[:excel_file]
sheet1 = book.worksheet 0
sheet1.each do |row|
row.set_format 1, Spreadsheet::Format.new(:number_format => 'MM/DD/YYYY')
h = Hash.new
h["name"] = row[0]
h["date"] = row[1]
......
end
Currently h["date"] is not retrieving properly. So How should I retrieve the date column properly with my original formatting. Can anyone help me to sort this out !