How to find time difference between Date-Times and set to Time field of Creator
- startTime = zoho.currenttime.subHour(2).subMinutes(24).subSeconds(4);
- endTime = zoho.currenttime;
- timeGap = startTime.timeBetween(endTime);
STEP 2: Structure Time String for Time Field
There's an issue with the time_gap function. It only returns a value when there's a difference between the compared times. If there's no difference, the function returns nothing.
To address this, we can loop through a range of three values (0 to 2) and replace any empty responses with "00".
- timeList = timeGap.toList(":");
- finalTime = "";
- loopArr = [0,1,2];
- for each i in loopArr {
- scaleTime = (if(timeList.size() > i,timeList.get(i), "00").toString().leftPad(2)).replaceAll(" ", "0");
- finalTime = finalTime +":"+ scaleTime;
- }
- info finalTime.removeFirstOccurence(":");
You can use finalTime variable to assign in Time field.
Coding is fun :) Have a great day!
Sticky Posts
Introducing Creator Simplified: An exclusive learning series to enhance your app development skills
Hey Creators! Welcome to Zoho Creator's new learning series, Creator Simplified. In this series, we'll dive into real-world business use cases and explore how to translate your requirements into solutions in your Creator application. You can also expect
ANZ In-Person Zoho User Group Meetups: Focusing on Zoho Creator & Zoho Flow (September 2024)
Hello, Zoho Community! Calling all Zoho users in Australia! We're thrilled to announce the next series of Zoho User Group (ZUG) Meetups, continuing the success of our previous sessions. These meetups are a great opportunity to learn, network, and engage
[SESSION ENDED] Ask the Experts #07| Live Q&A: Building workflows with Blueprint in Zoho Creator |
Hello, Post the release of Zoho Creator Blueprint last month, we're happy to tell you that we'll be launching a new 'Ask the Experts' session on 16th September (Thursday) this month focussing on creating blueprints in Zoho Creator. The session will be
Zoho Creator Community Webinars | October - November 2020 [Completed]
Hello everyone, I’m happy to announce that Zoho Creator is hosting a new Community Webinar Series starting this October. This series is a learning initiative aimed at our developer community, where every session will take spotlight use cases focused on
Community Learning Webinar - Zoho Creator Blueprint & other release updates | July 29, 2021
Dear developers, This June, the Creator team unveiled a slew of updates including UI enhancements to the Detail View of reports, an new capabilities in Data Import and Connections, and most important of all, the release of Blueprint in Creator. Customize