Different apps talk about date and time values in different ways. American, European, International—there are so many date formats, that it's a challenge to transfer date-time values across apps automatically. Some apps may not accept other date formats, while others may misinterpret the value. For example, if an app receives an input value as 04-03-2020, it may understand it as 4 March 2020, or 3 April 2020, depending on its configuration.
Letter | Date or Time component | Examples |
y | Year | 1996; 96 |
Y | Week year | 2009; 09 |
M | Month in year | April, Apr, 04 |
w | Week in year | 18 |
W | Week in month | 3 |
d | Day in month | 10 |
D | Day in year | 211 |
E | Day name in week | Monday; Mon |
a | AM or PM marker | PM |
H | Hour in day (0-23) | 2 |
h | Hour in AM/PM (1-12) | 3 |
k | Hour in day (1-24) | 21 |
K | Hour in AM/PM (0-11) | 10 |
m | Minute in hour | 54 |
s | Second in minute | 30 |
S | Millisecond | 853 |
X | ISO 8601 timezone | -08; -0800; -08:00 |
When apps send data through APIs, they always use a specific format. You can look at the app's API documentation to identify the date format it uses. Some apps use different formats for different entities. Make sure you refer to the date format in the right section of the documentation.
Another way to find the date format is by looking at the data coming in to your flow. When you test the trigger, the output will contain the date value.
When you configure actions, we try to display the accepted date format as much as possible.
Consider a flow that creates a project in Zoho Projects when a deal is created in Zoho CRM. When we look at the data CRM sends for a new deal, we see that the date is in yyyy-MM-dd format.
While configuring the action in Zoho Projects, we see that it accepts only MM-dd-yyyy format.
Because of this inconsistency, we can't map the date values directly from CRM to Projects. Now that we've identified what we need to work with, let's look at how to convert the date value.
To convert date from CRM to Project's format, we use a custom function between the trigger and action.
Use this code to create your custom function:
In our flow, we'll use the custom function between the trigger and the action. We need to map two date values: start and end date. So we use the custom function twice and map the output of the functions to the respective fields in Zoho Projects.
You can also include the date format in the custom function code, if you're going to use the function for a specific case.
This function converts any date format to the standard format of yyyy-MM-dd HH:mm:ss, then to the specified format (MM-dd-yyyy in this case). If you choose to use this kind of function, you need to write a different function for each output date format.
When you work across countries, you need to make sure your flows work with varying time zones. Custom functions help convey these date-time values across time zones accurately.
You can also use custom functions to add or subtract date-time values and set reminders. To understand how to do this, let's build a flow to notify your team on Zoho Cliq a day before a meeting scheduled in your Google Calendar.
We'll use this custom function to calculate the day before the event:
The date of the meeting is the input of this custom function. This function then calculates the date before the day of the meeting.
Now we add a delay that stalls the flow until the date provided by the custom function. The flow then sends a reminder to the team.
Depending on your requirements, you can modify these functions or write your own. Refer to the Deluge help page to learn more about functions you can use.
If you'd like to talk with us about date and time formats, shoot us an email at support@zohoflow.com.
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.