Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def convert_datetime(hash, date_symbol_or_string)
- attribute = date_symbol_or_string.to_s
- return DateTime.civil(hash[attribute + '(1i)'].to_i, hash[attribute + '(2i)'].to_i, hash[attribute + '(3i)'].to_i, hash[attribute + '(4i)'].to_i, hash[attribute + '(5i)'].to_i, hash[attribute + '(6i)'].to_i)
- end
Add Comment
Please, Sign In to add comment