Deluge Tips & Tricks: Mastering dates and times

Deluge Tips & Tricks: Mastering dates and times

Hello everyone!

We're bringing back our Deluge Tips & Tricks series, where we show you how to make the most of Deluge for achieving a wide range of use cases.

Working with dates and times is a fundamental part of almost any business application. Whether you're timestamping entries, scheduling tasks, or sending notifications, knowing how to manipulate date and time values in Deluge is a crucial skill.
 
Deluge provides simple yet powerful functions to help you fetch the current time, reformat values, and perform time zone conversions. This post highlights how Deluge can become your go-to for handling many different use cases.
 
Zoho variables 
Let's begin with the basics. Zoho variables are special predefined variables in Deluge that can be used across different Zoho services. Currently, Deluge offers two such variables related to dates and times: zoho.currentdate and zoho.currenttime. These return the current date, and the current date and time respectively, based on the format you've configured in the settings of the respective Zoho service. For more information, visit the Zoho Variables help doc.

While the aforementioned Zoho variables are your go-to for fetching the current date and time, their default format is primarily useful for basic logging. But, in many scenarios, you may need to display this information in a different format or even convert it to another time zone. Fortunately, Deluge has you covered. Let's take a look at how:

Customizing date and time formats   

Converting date formats
Different users often prefer different date formats when entering data, and Deluge makes it easy to handle these variations. For example, if you have a date stored as a string and need to convert it into a date variable, either to perform calculations or reformat it, you can use the toDate() and toString() built-in functions.

Here's a sample script which converts date from the dd/mm/yyyy format to the dd-mm-yyyy:

// Convert a string to a date variable

dateAsString = "03/12/2024 03:15:35";

dateObject = totime(dateAsString, "dd/MM/yyyy hh:mm:ss");

info dateObject;

// Convert the date object back to a string in a new format

info dateObject.toString("dd-MM-yyyy hh:mm:ss");

 

Converting time formats (24 hours to 12 hours)

You may sometimes need to switch between a 24-hour format and a 12-hour format when using zoho.currenttime. Thankfully, Deluge makes this simple. Here’s how you can do it:

currentTime = zoho.currenttime;

info currentTime.toString("dd-MM-YYYY hh:mm:ss a");

// Example output: 25-09-2025 11:11:11 AM

Handling time zone conversions  

In today's globalized world, your customers may be spread across different time zones, and to add to the complexity, large countries like the USA or Russia have multiple time zones even within their own borders. This can easily lead to head scratching scenarios when working with time-based data. Fortunately, Deluge has got your back here too.

The trick is to first convert the date-time string into a unixEpoch timestamp and then use toDateTimeString() to display it in the target time zone.

Converting your account's time to a user's time zone 

The zoho.currenttime variable returns the time based on the setting you've chosen. Let's assume that your account is set for IST (Indian Standard Time) and you want to display it for a user in Los Angeles. Here's how to do it:

// zoho.currenttime returns an IST time

datetimeString = "21-Aug-2025 15:50:13";

 

// Convert the string to a Unix timestamp

unixValue = datetimeString.unixEpoch();  

// Convert the Unix timestamp to a datetime string in the target timezone

info toDateTimeString(unixValue, "dd-MMM-yyyy hh:mm:ss", "America/Los_Angeles");

// Output: 21-Aug-2025 03:20:13

 

 

Converting between two specific time zones 

What's more, the same approach can also be applied to convert between two time zones. You can specify the source time zone during the Unix conversion to do this. This is particularly useful when your input string is from a known time zone that isn't your server's default.

 

The below script demonstrates time conversion from IST to Sydney time:

// Specify the source timezone (IST) when converting to Unix epoch

unixValue = "25-Aug-2025 14:28:53".unixEpoch("IST");

 

// Convert to the target timezone (Australia/Sydney)

info toDateTimeString(unixValue,"dd-MMM-yyyy HH:mm:ss","Australia/Sydney");

// Output: 25-Aug-2025 18:58:53

 

You can learn more about toTime and toDateTimeString functions at these help links.

 

We hope these tips help you handle date and time operations in your Deluge scripts more effectively—they can be used across all Zoho services that support Deluge.

 

Deluge is a vast and powerful language and we aim to help you master it to make your life easier. We'll be back with more tips and tricks soon, so stay tuned!

 

And if you have any questions or other cool tricks, please share them below!

 

Until next time,

The Deluge Team


        • Recent Topics

        • issue with image thumbnails not showing in Image Selector

          We have been using Zoho Campaigns for over a year, maybe close to two years, and this issue just started happening in the last month. I wanted to wait to see if it would resolve on it's own, and it doesn't seem to be. The thumbnail images for all new
        • Deluge Script for adding tag

          Trying to create a custom function where a tag is added to a record - but for the life of me, I cannot figure out how. Help please! Moderation Update: Adding the help doc and sample to add Tags to records via deluge here for everyone's benefit. tag1 =
        • Unlock your Zoho Vault with OneAuth, Windows Hello, TouchID, YubiKey, and many more!

          Hello everyone, We are thrilled to introduce one of the most highly requested features – the ability to unlock your Zoho Vault using various authenticators. The primary purpose of a password manager is to remember just one master password and securely
        • Blueprint or Validation Rules for Invoices in Zoho Books

          Can I implement Blueprint or Validation Rules for Invoices in Zoho Books? Example, use case could be, Agent confirms from client that payment is done, but bank only syncs transactions tomorrow. in this case, Agent can update invoice status to done, and
        • Creator roadmap for the rest of 2022

          Hi everyone, Hope you're all good! Thanks for continuing to make this community engaging and informative. Today we'd like to share with you our plans for the near future of Creator. We always strive to strike a good balance of features and enhancements
        • How can I get base64 string from filecontent in widget

          Hi, I have a react js widget which has the signature pad. Now, I am saving the signature in signature field in zoho creator form. If I open the edit report record in widget then I want to display the Signature back in signature field. I am using readFile
        • Add Setting Values to the Rules

          Hi, It would be great to use the rules to set values in fields for submission, such as if a Type is X then set the Field Y to 10. Thanks Dan
        • So we ran with it for the week

          In our company i bit the bullet and ran with FSM for a whole week. Service calls, deliveries and surveys. Covering about 30-120 miles a day to domestic properties. Loved the appointment list and satnav integration. Loved the timer to measure the appointments.
        • Is there a way to set Document Owner/Sender via the API

          When sending requests for zoho sign, it would seem zoho uses the id of the person that created the zoho api cred to determine the owner_id, is there a way to set a default for this?
        • What's New - September 2025 | Zoho Backstage

          September has been a different month for Zoho Backstage. Instead of rolling out a long list of new features, we focused on something just as important: Performance, reliability, and stability The event season is in full swing, and organizers are running
        • Prevent stripping of custom CSS when creating an email template?

          Anyone have a workaround for this? Zoho really needs to hire new designers - templates are terrible. A custom template has been created, but every time we try to use it, it strips out all the CSS from the head.  IE, we'll define the styles right in the <head> (simple example below) and everything gets stripped (initially, it saves fine, but when you browse away and come back to the template, all the custom css is removed). <style type="text/css"> .footerContent a{display:block !important;} </style>
        • Stock Quotes/Spreadsheet

          It would be nice if we could download security and mutual fund prices from Yahoo Finance (or?) in order to maintain an up to date investment portfolio on Zoho. Any chance?
        • link to any Belgian bookkeeping software?

          Hello, Does anyone on this Forum can help me with the question whether the ZOHO CRM (Invoices) or ZOHO Book can be linked to software that is used for Belgian Bookkeeping/accountancy? By linking, I mean either with the help of a middleware program or either by the ability to export the custom made reports as CSV-files... If someone has an experience with online CRM-Accountancy in Belgium, with ZOHO (or other), it would be great to read it... Thank you
        • marketing automation

          wants to know about the zoho marketing automation
        • Create custom rollup summary fields in Zoho CRM

          Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
        • Problems with email templates (HTML - Outlook)

          Hi there, I've been trying to create a newsletter from the template "Business 4". Everything looks great in the preview, but when I send it to my Outlook inbox, the layout doesn't seems to stick. More particularly: - The line-height is way more reduced, even though I used the line-height tool from the template - Columns but they are sometimes misaligned - Font size is not always the one I've selected. Could you help? Thanks!
        • Zoho CRM IP Addresses to Whitelist

          We were told to whitelist IP addresses from Zoho CRM.  (CRM, not Zoho Mail.) What is the current list of IP Addresses to whitelist for outbound mail? Is there a website where these IP addresses are published and updated?  Everything I could find is over
        • How to create a drop down menu in Zoho Sheets

          I am trying to find out, how do I create a drop down option in Zoho sheet. I tried Data--> Data Validation --> Criteria --> Text  --> Contains. But that is not working, is there any other way to do it.  Thanks in Advance.
        • Introducing Keyboard Shortcuts for Zoho CRM

          Dear Customers, We're happy to introduce keyboard shortcuts for Zoho CRM features! Until now, you might have been navigating to modules manually using the mouse, and at times, it could be tedious, especially when you had to search for specific modules
        • Zoho CRM's custom views are now deployable from sandboxes

          This feature is now available for users in the AU, JP, and CN DCs. This feature is now available for users in CA and SA DCs. New update: This feature is now available for users in all DCs. Hello everyone, We're excited to announce that you can now deploy
        • Where are Kanban swimlanes

          So i've been playing with Zoho Projects Kanban view a bit more. It appears that task lists are being used as the Kanban columns, which makes sense from the implementation point of view but not the logical one.  Kanban columns are statuses that a task can flow through, while a task list has been a logical way to organize related tasks and relate them to a mislestone. In other words a task in a particular task can go through several stages while remaining in the same task list. After doing some research
        • Send Automated WhatsApp Messages and Leverage the Improved WhatsApp Templates

          Greetings, I hope all of you are doing well. We're excited to announce a major upgrade to Bigin's WhatsApp integration that brings more flexibility, interactivity, and automation to your customer messaging. WhatsApp message automation You can now use
        • Scheduling Calls in CommandCenter / Blueprints

          I would love it if you could add a function to schedule a call in the lead's record for a future date. I know you can add a Task by going to Instant Actions > Task and completing the form: These tasks go into the lead's record under Open Actions. But
        • Zoho One - Syncing Merchants and Vendors Between Zoho Expense and Zoho Books

          Hi, I'm exploring the features of Zoho One under the trial subscription and have encountered an issue with syncing Merchant information between Zoho Expense and Zoho Books. While utilizing Zoho Expense to capture receipts, I noticed that when I submit
        • Limit in number of records for subforms and multi-select lookup fields

          It is my understanding that a maximum of 100 items can be selected in a multi-select lookup field, and that a total of 200 items can be selected in total between both subforms in a given module.  Are there any ways to work around this limitation if we
        • Kaizen #136 - Zoho CRM Widgets using ReactJS

          Hey there! Welcome back to yet another insightful post in our Kaizen series! In this post, let's explore how to use ReactJS for Zoho CRM widgets. We will utilize the sample widget from one of our previous posts - Geocoding Leads' Addresses in ZOHO CRM
        • Getting Permission denied to access this portal.

          We have one user that can't login to projects even though access has been granted. This user can login to accounts.zoho.com but when login to https://projects.zoho.com/portals.do we get this error: Unauthorized login to this portal Permission denied to access this portal. Check your portal URL again. Sometimes we also get "server too busy". We have tried killing sessions (in accounts.zoho.com) and we have deleted cookies; and tried different computers and still the same problem. All others use can
        • Marketing Tip #1: Optimize item titles for SEO

          Your item title is the first thing both Google and shoppers notice. Instead of a generic “Leather Bag,” go for something detailed like “Handcrafted Leather Laptop Bag – Durable & Stylish.” This helps your items rank better in search results and instantly
        • Does Zoho Docs have a Line Number function ?

          Hi, when collaborating with coding tasks, I need an online real time share document that shows line numbers. Does Zoho's docs offer this feature ? If yes, how can I show them ? Regards, Frank
        • Setting Default Views for Custom, List and Detail Views

          Hey, Is it possible to set a default custom view, list view and detail view for a module for every user? We are onboarding a lot of non technical people that struggle with these things. Setting the views as default would really help. Btw: also setting
        • Custom function return type

          Hi, How do I create a custom deluge function in Zoho CRM that returns a string? e.g. Setup->Workflow->Custom Functions->Configure->Write own During create or edit of the function I don't see a way to change the default 'void' to anything else. Adding
        • Filter Based API request in Zoho Books using POSTMAN

          How do I GET only specified CONTACTS based on created time or modified time in Zoho Books using POSTMAN. In the api documentation, it is written we can apply filters but I need a sample request.
        • URL validation

          We use an internal intranet site which has a short DNS name which Zoho CRM will not accept.   When attempting to update the field it says "Please enter a valid URL". The URL I am trying to set is http://intranet/pm/ Our intranet is not currently setup with a full DNS name and given the amount of links using the shortname probably isn't a feasible change for us.
        • Has anyone been experiencing slow issues?

          Dear all, I just want to ask if anyone has been experiencing slow issues with Zoho Creator in the past two weeks? I worked with the ISP to improve network quality by changing routes and upgrading bandwidth, but nothing changed. I am in Vietnam.
        • Zoho Projects Roadshows 2025 - USA

          Dear Users, After an amazing response to our roadshows in 2024, we are excited to be back for the second year in a row! Join our team of experts as they walk you through the most-used features in Zoho Projects, explore powerful automation capabilities,
        • Billing Management: #6 Usage Billing in SaaS

          Imagine a customer shuffling across multiple subscriptions, a streaming service, a music app, cloud storage, and a design tool. Each one charges a flat monthly fee, regardless of how much or how little they use. Some months, the customer barely opens
        • Is there anyone who has been experiencing issues regarding the Zoho Creator Certification Website in the past 2 weeks?

          Dear all , I just wanted to ask is there anyone who was planning on taking the Zoho Creator Developer Certification Test in the past 2 weeks and have been facing errors stating that the website is under maintennance and also not allowed to access the
        • Directly Edit, Filter, and Sort Subforms on the Details Page

          Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
        • GST Slabs Redefined: Stay Compliant Using Zoho Books!

          Hello Everyone! The Government of India is rolling out new GST rates, a major reform aimed at simplifying the current tax structure starting 22 September 2025. GST will move from four slabs (5%, 12%, 18%, 28%) to two main slabs (5% and 18%), plus a special
        • Allow syncing Activities from other applications

          Marketing Automation could be a much more powerful platform if you were able to sync activities into the platform (e.g. purchase, donation, etc) outside of a user doing something on your website. I'd love it if you could sync Custom CRM Modules as activities,
        • Next Page