cancel
Showing results for 
Search instead for 
Did you mean: 
adi_kulk
Nintex Newbie

Working with date and time

Jump to solution

Hello everyone, 

 

I have a Nintex form with the following fields:

fields.PNG

In Prior Date & Time Relieved: the first control is the standard datepicker and the remaining two are choice controls for hours (0-23) and minutes (0-59). The same thing applies for Date & Time: Time on Duty. 

 

Is there a way I can concatenate the date, hours and minutes values for both the highlighted fields to represent a date with hours and minutes (for eg: 07/16/2019 03:49)? If yes, can I subtract these values to show the difference in hours and minutes? The requirement is to subtract Prior Date & Time Relieved from Date & Time: Time on Duty as follows:

if Prior Date & Time = 07/16/2019 15:00 and Date & Time: Time on Duty = 07/16/2019 16:00, the calculated value should show 01:00.

 

I know we can subtract dates using 'datediffHours' and 'datediffMinutes' inline functions with the standard datetime picker control, but it only supports 5 minutes increments and I need 1 minute time increment. 

 

Please let me know if this could be done.

 

Thanks,

Adi

Labels: (1)
0 Kudos
Reply
2 Replies
Nintex Employee
Nintex Employee

Re: Working with date and time

Jump to solution

Hi,

I have put together a sample form for you and attached it.

I concatenate the Date from the date control and the hours and minutes from the dropdowns using the Date runtime function in a calculated value control.

This is done for both dates and times and then you can use one of the datediff functions to get the total days, hours or minutes difference by comparing the two calculated value controls.

 

Sample of the function that concatenates the 3 controls.

date(formatDate(D1,"dd"),formatDate(D1,"MM"),formatDate(D1,"yyyy"),H1,M1)

 

Sample.png

View solution in original post

Reply
adi_kulk
Nintex Newbie

Re: Working with date and time

Jump to solution

Thanks a lot Simon Smiley Happy That solved my problem.

0 Kudos
Reply