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
Firas Taamallah 18Firas Taamallah 18 

How to compare Date with string in Apex?

Hello , 

My requirement is to verify if Date.now is in Date (String or no ? 
Example :
  •  String :  7Am-7PM UTC+1  , i want to verify if Date.now is in this period or no  field Business Hour 
i should use Invocable Method because i will call this method in Flow so the signature of my method
 
@InvocableMethod
    public static List<boolean> checkBusinessHours(List<Id> ButtonIds){
List<Entity> ents = [Select BusinessHour from Tntity where Id in ButtonIds];
// i should return list of boolean because InvocableMethod methods do not support return type of Boolean

return new List<boolean>{false};

}

Any help would be appreciated