The time on the browser and the time on the database (Sequel Ace) will be different.
require "date"
DateTime.now
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
-
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
Related articles
- ruby on rails - it works fine on the browser, but the rspec test doesn't pass
- ruby on rails - it is not saved in the database after registering the product
- ruby on rails - after deploying, the database defalut setting is 0
- ruby on rails - no information sent to database
- ruby - the last db setting doesn't work when deploying rails app on aws
- ruby - about implementation of tag function in rails
- ruby on rails - i want to display the posted images in a random order (get information from the record)
- ruby on rails - [rails] i'm implementing a search function using form_with, but i'm having trouble with the search results not b
- ruby on rails - i would like to add an automatic address input function to the new registration screen
- ruby - [rails] i want to find the date difference using the model created_at
- ruby on rails - i want to resolve rails wrong number of arguments
- ruby on rails - questions about routes
- ruby - [rails] i want to create an image link using the url of the image output using active storage
- i want to convert wav to mp3 with ruby on rails and pass it to active strage
- ruby - rails causes activerecord :: recordnotfound and routing error at the same time
- ruby on rails - after installing devise on rails6, routing error occurs, so i want to eliminate it
- ruby on rails - i want to resolve rails nameerror
- ruby on rails - i can't update rubygems
- ruby - about "activemodel :: unknownattributeerror" of rails
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable
I was able to do it with .where (created_at: Time.now.all_day).