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

    • How To Implement an Auto-Check-out Feature for Attendance?

      If an employee forgets to check out, the system should automatically check out the employee at 6:30 PM
    • Bookings Notifications for Staff

      Good afternoon.  We are currently working on the trial version of Bookings as we review its usage for our client needs to schedule with specific team members.  We set everything up and it appears to be working, with the exception of sending an email to
    • Is COQL known to have read delays?

      Hello, I'm experiencing stale data returned by COQL from time to time. Most of the time it returns up-to-date data right after I update a record, but sometimes the change only shows up after several seconds or even minutes. Neither the COQL documentation
    • #18 Billing for the Hours, Not the Job

      A consultant in the comments last month put it plainly: her client pays by the hour and wants to see every hour on the invoice, including the dates. She was maintaining a spreadsheet and manually copying the totals into her invoices. If you bill by the
    • WhatsApp con bot en Make y derivación a una persona en Zoho CRM

      Estamos implementando en Zoho CRM un flujo de atención por WhatsApp con un bot en Make y una derivación a una persona. Necesitamos que cada mensaje quede registrado, que me avise cuando requiere atención y poder seguir la misma charla con el cliente.
    • Webhooks for Bigin

      Hello everyone, Say hello to webhooks in Bigin—a way to send information to other applications automatically the moment something happens to a record. Whether it's a deal moving stage, a contact being created, or a field changing, Bigin can now send an
    • Giving someone access to my FSM to develop + scope.

      Good evening, I’m new to Zoho, and had a CRM/Creator customized and it was missing something and not working. I realized it’s the functions and process and FSM was the missing link. I am trying to get FSM setup and all I have to do connect to CRM, Books,
    • Set Custom Icon for Custom Modules in new Zoho CRM UI

    • Reassign a team member's follow-up tasks without moving their customers | Kiosk Studio Session #13

      Hello folks, It's almost year-end, and a lot of people on your team will take time off. Their customers will still need things while they're away. Say Amanda is out next week (on leave). She has a renewal purchase order to chase for Grace, a quote Vikram
    • WorkDrive and CRM not in sync

      1/ There is a CRM file upload field with WorkDrive file set as the source: 2/ Then the file is renamed in WorkDrive (outside CRM): 3/ The File in CRM is not synced after the change in WorkDrive; the file name (reference) in CRM record is not updated (here
    • Short product videos on Zoho Commerce product pages: what works?

      Short product videos are becoming a normal part of online store pages, and I have been thinking about how to use them well on a Zoho Commerce store. A few points that seem to matter: Keep them short. 6 to 15 seconds showing the product from a few angles
    • Error AS101 when adding new email alias

      Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
    • Meet the new Zoho Analytics: The Agentic Analytics platform

      Every major release of Zoho Analytics has changed what you can do with data. This one changes who does the work. For years, analytics meant a chain of hands. The engineer shaped the data, the analyst wrote the query, the designer built the dashboard,
    • Function failure APIs report "no failures" (204 / empty 200) while the Failures view lists real failures

      We want to monitor custom-function failures through the API so we can find and re-run failed functions quickly. We could not find a function-failures endpoint in the API reference (only webhook failures are documented), so we tried the paths that exist
    • Unlock more with Linkthread's new Basic plan

      Hey everyone, Last year, we introduced Linkthread by Zoho Social with a simple idea: help users bring everything they want to share into one link. Since then, Linkthread has continued to evolve, and we’re excited to announce its next milestone—the launch
    • Rating system button not translated to Spanish + "Done"

      I've run into a issue with the new system for rating support interactions when the chat is ended: Missing Spanish translation: The button is still showing in English as "Done," even though the interface language is set to Spanish. It should display something
    • 【11/19(木)15時〜・先着5名】後回しになっているZohoの設定、一緒に進めませんか?|オンラインもくもく会

      ユーザーの皆さま、こんにちは。 コミュニティグループの中野です。 「試したい機能や設定があるけれど、日々の業務で後回しになっている」 「一人で検証していると、途中で手が止まってしまう」 「ほかのユーザーがどう運用しているか、聞いてみたい」 そんな方に向けて、11月19日(木)にオンラインの「Zoho ワークアウト」を開催します。 参加者それぞれが取り組みたいテーマを持ち寄り、設定・検証・運用改善を進める少人数の「もくもく会」です。 各自で作業しながら、必要に応じてユーザー同士で相談や情報交換ができます。
    • Connection into Cliq?

      I have the SalesIQ chat widget on my site using the Zohobot but I'm not always on and my employees don't keep it open all the time. We do have Cliq open all the time though so I'd love a way to manage those discussions directly in Cliq as they come in.
    • Sharedmail box access via an api

      Hi, I am trying to access a sharedmailbox via an API. I am the moderator and creator of this shared mailbox. I have created a self client but when when i try to get list of all emails, it does not list the sharedmailbox. Help me to resolve this or provide
    • Multiple Topics assigned to a single Campaign

      Hello, is it possible to assign multiple Topics to a single Campaign? We frequently write a content to our subscribers that spans multiple Topics and we would like to send it to all Contacts that are subscribed to at least one of the Topics. But it looks
    • Zoho Campaigns - Accept Rollup Summary As Format In Use

      Hi Zoho Team, I would like to request an enhancement to the integration between Zoho CRM and Zoho Campaigns. Currently, Rollup Summary fields in Zoho CRM are available for selection during field mapping, but I am unable to map a Rollup Summary field containing
    • Is it possible to change the percentage field in zoho crm , to put 3 decimals ?

      Hello , I need to write 1,444 in the percentage field in zoho CRM. However, I've noticed that there is a limitation of 2 decimals for this field. I've found out that if I replace this field with a Decimal one (.OO), I can choose to have 3 decimals. I've
    • Save hours daily this peak season: Better Inventory & Shipping with Zoho on Easyship

      Peak season shouldn't mean losing control of your inventory just to keep up with demand. When the holiday rush hits, everything in your business gets tested at once. Orders surge, stock runs low, and shipping costs climb as customers expect faster delivery
    • How Can Zoho Desk and Knowledge Base Help Manage Technical Support for an Android TV Website?

      Hello everyone, I manage MXL TV App, an independent technology website covering Android applications, Android TV, Smart TVs, digital entertainment, installation guides, and troubleshooting. I'm exploring ways to organize technical questions and make helpful
    • Build a Legacy of Support with Zoho Desk

      Hi everyone, World Heritage Day, also known by the name International Day for Monuments and Sites, is a moment to celebrate the stories, culture, and history preserved in the monuments, landscapes, and heritage around us. At Zoho Desk, heritage is not
    • Documents greater than 40MB Preview

      hello, Documents bigger than 40 MB cannot be previewed in WorkDrive Web App or Mobile App. would it be resolved in future?
    • IP de salida 165.173.182.12 en lista negra (nosolicitado.org) – correos rechazados por Odoo

      Hola equipo de soporte de Zoho Mail: Les escribo porque mis correos están siendo rechazados por un destinatario debido a que una de sus IPs de salida aparece en una lista negra. Detalles del rebote: - Cuenta / dominio: [tu correo] / [tu dominio] - Destinatario:
    • Issues with Zoho Sheet in Mac

      I have downloaded the Zoho App from App Store but It is failing to Save As, Open & Download Operations. App Store
    • To-do lists screwed up by update

      My app just updated, and now it's unusable for my grocery and packing lists and pretty much everything I use this app for. It used to be that when you checked a box on a to-do list, the item was automatically migrated to the bottom of the list. Then when
    • Campaign send from unverified e-dress

      L.S. I have a problem with z-Campaigns. My email (sender) address seems to be unverified: Verified domain. Sender couldn’t be verified This email is from your organization’s verified domain, but the sender couldn’t be verified. It may be an automated
    • Change default "Sort by"

      Is there a way to change the default "sort by" when searching across modules?" in Zoho CRM? Currently the default sort method is "Modified time" but i would like to utilize the second option of "relevance" as the sort by default and not have to change
    • New Search Function

      Hey Team, The search function updated in our CRM about a week ago, so I assume it was an automated update across Zoho. It no longer displays leads/deals etc in Chronological order so that the most recently created or updated is the first to display which
    • Large List on Sub-Forms

      Hi, I would like to be able to add and use the Large List on a Sub-Form, currently it doesnt appear to show up for Sub-Forms. Thanks Dan
    • Feature Request: Post-commit Subform Row Event (onRowSave / afterRowCommit) in Client Scripts

      Hello Zoho CRM Product & Engineering Team, Requested Feature: Introduce an afterRowCommit (or post-commit onRowSave) subform event in Client Scripts that fires immediately after an inline subform row has been successfully committed to the database, passing
    • #CyberSecurityAwareness - Be diligent when it comes to Widget security

      We love Widgets in Zoho CRM! And in our experience they have become an essential tool for extending the feature set and providing a rich user experience beyond standard CRM UI, functionality and integrations. BUT BEWARE... If you are thinking of adding
    • Introducing the Zoho Campaigns MCP server

      Hello everyone, We are pleased to announce that Zoho Campaigns is now available in Zoho MCP. You can now connect your Zoho Campaigns organization to AI tools such as Claude, ChatGPT, GitHub Copilot in VS Code, and Cursor, and manage your email marketing
    • Deluge {"trigger":{"workflow"}} Do we need to add the id of rules of functions or rules in the workflow ?

      Hello , I've user {"trigger":{"workflow"}} in Deluge language. In my Deluge code, in order to trigger the workflow, I've specified the id of the workflow, of the rules and of the function called by the workflow. However, Zoho CRM told me that it was not
    • Let’s Talk Recruit: Answering your hiring review’s top five questions

      Picture this, it's the final week of the month, and your hiring review is just around the corner. You already know the questions you'll be asked. Which roles have been open the longest? Why did the Product Designer pipeline go quiet after the second interview?
    • What's New in Zoho POS - October 2026

      Hello everyone, Welcome to Zoho POS’s monthly update, where we bring you the latest feature releases, enhancements, events, and more. Let’s take a quick look at the new item price override option for embedded barcodes and how it can help streamline your
    • VENDORS ARE NOT SYNCHED WITH CONTACTS IN CRM

      Hello, While the ACCOUNTS and CONTACTS (Including the primary contact) are synced with the CONTACTS module in CRM, the vendor's CONTACTS are not synced with CRM - which basically forces the users to re-enter all vendor's contacts twice and then update
    • Next Page