I want to change this scrip to delugue

I want to change this scrip to delugue

Hi. I want to change the following scrip to delugue
The code does this:
I have an application where entry and exit times are recorded. I want to calculate which hours are daytime and which are nighttime, with nighttime hours being from 9 PM to 6 AM.

For example if I have start time 6pm and end time 10pm wil be 3 hours day time 1 night time

Periods can cross midnight 

Daily hours
Let( [ a = Max(Time(06:00:00); Hora_Inicio); b = Min(Time(21:00:0); If(Hora_Fin < Hora_Inicio; Hora_Fin + 86400; Hora_Fin)); ]; Max(0; b - a) )

Night hours
Let(
[
a = Max(Time(21; 0; 0); Hora de inicio);
b = Min(Time(6; 0; 0)+ 86400; If(Hora de fin < Hora de inicio; Hora de fin + 86400; Hora de fin))
];

Max(0; b - a)

)


    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now