+09:00 Time.use_zone('Asia/Bangkok') { Time.current } => Tue, 09 Dec 2025 18:30:00.000000000 +07 +07:00 Time.use_zone('America/Chicago') { Time.current } => Tue, 09 Dec 2025 05:30:00.000000000 CST -06:00 # https://api.rubyonrails.org/classes/Time.html#method-c-zone # Allows override of Time.zone locally inside supplied block; # resets Time.zone to existing value when done. class ApplicationController < ActionController::Base around_action :set_time_zone private def set_time_zone Time.use_zone(current_user.timezone) { yield } end end # app/models/user.rb class User < ApplicationRecord has_many :branch_users, dependent: :destroy has_many :branches, through: :branch_users end • Time.use_zoneΛͬͯɺ ҙͷλΠϜκʔϯͰ࣮ߦՄೳ • around_actionͰ׆༻ͨ͠ Rails APIͷίʔυྫˠ • ͔͠͠ɺUserෳͷBranch (ߍࣷ)ʹॴଐͰ͖Δ🤔