Date and Time Techniques with Formatter by Zapier
With scheduled actions playing such a large role in automation, it’s no wonder that Formatter by Zapier includes a helpful selection of tools for manipulating date/time data.
These tips will show you some of the possibilities with Zapier’s Date/Time formatter steps, but there are many advanced use cases that we won’t cover here. We encourage you to explore the Formatter step on your own and try out everything it has to offer; you may be surprised at how much it can enable your automations to do!
To get started, just make a Zap with any trigger, and add a step with “Formatter by Zapier” as the app.
Adding and Subtracting Time
Adding time to a given date can be a very convenient way to schedule automations. For instance, you might want to send a check-in email to every new client one week after their project start date. Or you may just want to add some text in a formatted email to remind them about an upcoming deadline.
No matter what you want to add or subtract time for, Formatter makes it very easy. Just select “Date/Time” as your action event and choose “Add/Subtract Time” from the Transform list.
Then, enter your date you want to work with into the input field, and add the amount of time you want to add or subtract into the expression field.
You can write the time interval you want to add in plain language just by typing “1 day” or “4 minutes”. To subtract time, just make it a negative value like “-4 years” or “-3 weeks”.
Test the step, and you’ll see the output. You can then use this result in additional steps in your automation.
Comparing Two Dates
Comparing two dates is a useful method for determining how much time has elapsed between them, or for letting your automations figure out whether or not the two dates match. You could even set up a filter step to only perform certain actions when the two dates aren’t the same, or when they’re at least 10 days apart.
To use the comparison function, just pick “Date/Time” in a new formatter step and choose “Compare dates”. Enter your start and end dates in the appropriate fields, and specify the format of your dates if needed.
Test the data, and Zapier will calculate how much time passed between the two dates, and will indicate whether they’re the same date or not with a boolean “true/false”.
Sometimes when you’re working with automations and programmatically generated dates, you’ll end up with a long, ugly date and time string that’s not very easy for people to read. Other times, you’ll simply want to change the order of the month and the day for your international customers.
In either case, you can reformat your dates by picking “Date/time” and selecting “Format” from the transform list.
Just enter the date you want to reformat into the “input” field, select a new format for it from the list, and specify a timezone. You can also select the format that your input is using just to make sure that Zapier interprets the data correctly, but it usually works on its own anyway.
Test the step, and you’ll get a reformatted date as the output, which you can use in any subsequent steps in that Zap.
Enhancing your Zaps with Formatter
Formatter is one of the most useful and versatile tools for taking your Zaps up a notch. Whether you want to add some calculations and logic to your automations, or just want to make your text a bit more readable, Formatter will help you to sort out your date/time data.
You can find some more Formatter tips on our previous post here.