I have following sql in my controller:
@tot_expense = Expense.where("strftime('%m', created_at) + 0 = ?", Time.now.strftime("%m").to_i).sum("amount")
This works fine in my development environment. But after deploying in heroku it gives me the below error while saving the record.
PG::Error: ERROR: function strftime(unknown, timestamp without time zone) does not exist
I have uncommented
config.time_zone = 'UTC'
in my config/application.rb
file but it didnt work.