The time on the browser and the time on the database (Sequel Ace) will be different.
require "date"
When I display the time on the browser with, it is the current time in Japan, but when I update the data and look at the time of created_at with Sequel Ace, it is off by about 9 hours.
When I looked it up, it seemed like the time was around the UK, but is this a Sequel Ace issue or a rails issue? Since we are narrowing down the data by "today", we are in trouble because of the time difference.
We would appreciate it if you could teach us how to deal with it.

  • Answer # 1

    I was able to do it with .where (created_at: Time.now.all_day).

  • Answer # 2

    The one that differs by 9 hours is "International Standard Time". It is the time of longitude 0 where the Royal Observatory Greenwich, England is located.
    Here will be helpful