function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Milan HrdlickaMilan Hrdlicka 

Check if actual time fits in particular time range using datetime field

Hi all,

lets say it's Monday (I have solved this by using particular "Monday" date using datetime field) 10:00 am and I need to check whether this time falls into opening hours which does in below case.
Any suggestion of how to do that? Get actual time and somehow compare whether this falls in between opening and closing hours?
Can this be done by a single SOQL query? 

Opening Hours: 2017-01-02T07:30:00.000+0000
Closing Hours: 2017-01-02T19:30:00.000+0000

Appreciate your help on this.
Milan

 
vaishali sharmavaishali sharma
Is this the only format that you are using. The format of opening hours and closing hours.If you can match these format then you can achieve it using SOQL using simply > and < variables.
Milan HrdlickaMilan Hrdlicka
Yes, at the moment the only format I use.