Skip to main content
Nintex Community Menu Bar

Validate a Date/time field to be within certain hours (i.e. 9am - 5pm)

  • July 2, 2020
  • 2 replies
  • 35 views

Forum|alt.badge.img+1

Hi,

I have a Start Date/Time and and End Date/Time on a form.   I would like to validate that the Start and End Time are within business hours (i.e. 9am - 5pm).    Does anyone know how I would do that?

 

Thanks!Date/Time

2 replies

allan
Forum|alt.badge.img+9
  • Rookie
  • July 28, 2020
What type of form are you using ? (Classic, Responsive or New Responsive)

DAGiessenburg
Forum|alt.badge.img+4

If you have a New Responsive form and you use 24 hours format. You could do something like:

 

Create a variable: StartTime - Type String: 
formatDate([Form].[dtStart],"HH")


Create a form rule: Business hours:

if convertToNumber([Form].[StartTime]) >= 9 and

   convertToNumber([Form].[StartTime]) <= 17

Then do something like:

Label1 value is:  Business hours

Else
Label1 value is: Outside business hours