Time.zone.parse(_, options) => Time.zone.strptime(_, options)
This commit is contained in:
parent
f620e4aee2
commit
4b25d16f5a
3 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@ namespace :'2018_01_18_clean_datetime_in_champs' do
|
|||
|
||||
# Match "dd/mm/YYYY HH:MM" => "YYYY-mm-dd HH:MM"
|
||||
datetime_champs.select { |c| /^\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}$/ =~ c.value }.each do |c|
|
||||
formated_date = Time.zone.parse(c.value, "%d/%m/%Y %H:%M").strftime("%Y-%m-%d %H:%M")
|
||||
formated_date = Time.zone.strptime(c.value, "%d/%m/%Y %H:%M").strftime("%Y-%m-%d %H:%M")
|
||||
rake_puts "cleaning #{c.value} => #{formated_date}"
|
||||
c.update_columns(value: formated_date)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue