Time, Datetime, Weekday query to find records
Find records between time of the day (not date only time) It’s quite straightforward to find records between two datetime. But it would be little tricky to find records between two time, only time not datetime. We can write it that way: Task.where([“:date_time >= start_time::time AND :date_time <= end_time::time”, { date_time: DateTime.current.strftime(‘%H:%M:%S’) }]) Find records…
Read more