#Days Calculation in Botpress
# 🤝help
m
Hi there! I am trying to capture 2 dates from users and output the #days between them. I tried implementing it with execute code but it still takes the default 0 when outputting the leaveCount variable value. Not sure why that is the case. Here is the code I used. Would really appreciate your help!

https://cdn.discordapp.com/attachments/1133011635104125069/1133011635267698718/Screenshot_2023-07-24_at_14.22.59.png

a
Hey @mysterious-airplane-65637 that code looks correct. Let me play around with it a bit and get back to you
m
Thanks so much @acceptable-kangaroo-64719 ! 🙂
a
Hey @mysterious-airplane-65637 that code worked just fine for me. I put it in a bot here, you can check it out https://cdn.discordapp.com/attachments/1133011635104125069/1133015496258764843/BP_Coloring_Book_-_2023_Jul_24.bpz
m
Thanks! Sorry but I only have access to Botpress Cloud version atm. Could you please share the file via link if its possible?
a
that is a bp cloud version. You can download the file, then go to import/export > import from file

https://cdn.discordapp.com/attachments/1133011635104125069/1133018204843806911/image.png

m
Awesome thanks! Trying it out now
2 Views