Formatting Dates Using Liquid

Written by David

How to Format Dates in Drip Using Liquid

Drip is an email marketing platform that uses Liquid, a templating language developed by Shopify.

If you are unfamiliar with what Liquid Language is, you can read this article on Shopify’s website. In short, plain terms Liquid is a combination of merge fields, if this then that commands, and a text parser / formatter.

Here is an example:

Hi {{ subscriber.first_name | default:”there” }},

subscriber.first_name is the ‘merge field’ for a subscriber’s first name.

default notes ‘hey, if they don’t have a first name assigned then use this…’

“there” is what you show instead of the first name.

Liquid is powerful for marketing as it allows you to do things like:

  • Show a subscribers first name and if they don’t have a first name in the system, show a different word instead (as shown above)
  • Show only certain parts of a message to people who have a specific tag or attribute and hid that part of the message to people who DO NOT have that specific tag or attribute (this prevents you from having to send two different emails to two different segments)
  • Show one message for one segment of people and show a different message to a different segment of people in the same email (Group A sees Message A and Group B sees Message B)

One of the most powerful features of Liquid is the ability to change data that comes in to your system. For instance, if someone types their name as dave and you want all names to have a capitalized first letter, you can write a liquid code for this.

This tutorial demonstrates how to take a date that comes in to your system as a custom field and modify the formatting of that date.

The Need to Modify Date Formatting Using Liquid

If you’re reading this article you likely have a reason already for wanting to format a date. But if you’re still looking for a reason, here are a few.

  • Users submit a form into your email system with the format YYYY-MM-DD but you want to display that date in an email like this, January 1, 1972 (not 1972-01-01)
  • Once a date is assigned to a user’s profile as a custom field, you want to share that data downstream to another application but the other application requires a specific format, such as a unix timestamp
  • Your company has customers from all over the world and you want to display dates in formats that are more widely used depending on the region of the customer

There’s also a technical requirement specific to Drip worth knowing about: Drip’s date-based workflow triggers only recognize dates in ISO 8601 format (YYYY-MM-DD). If a date is stored in your custom field in any other format, the trigger won’t fire. That’s the core problem this article solves.

Here is my specific use case which I’ll demonstrate in this article.

I have customers who are signing up for a 40-day challenge and they get to choose which day they want to begin. Drip has a feature in their workflow automations that allows a workflow to start based upon a date. However, the date must be stored in the custom field in a specific format — ISO 8601 (YYYY-MM-DD). The form they submit their date preference through uses the format MM/DD/YYYY, so I need to convert it before Drip can use it as a trigger.

Step 1: Assign the Date to a Custom Field

The date is coming in from a Gravity form and must be stored somewhere. As far as I know there is no way to format the date using just Gravity Forms and Drip without first storing the information inside of a Drip custom field.

I have created a custom field nmdd_challenge_start_date to store the date from Gravity Forms.

Step 2: Create a Custom Field for the Formatted Date

I need a place to store the newly formatted date so I have created a second custom field where this formatted date will go: nmdd_challenge_start_date_formatted.

This second field is the field that I will use to trigger the automation.

Step 3: Create a Tag to Trigger Trigger the Drip Rule to Fire

In step 4 we will use a Drip Rule to format the text, but we need something to tell the rule to fire. There are lots of ways you could do this and for the most part there is no ‘right way’.

I am choosing to assign a tag to a subscriber in order to trigger the rule for the reason that I largely use tags to trigger just about everything. For me this is about consistency.

I created the tag admin-format_date-nmdd_challenge_evergreen and apply that tag to the user when they fill out the initial Gravity Form.

Step 4: Configure the Formatting via Drip Rule Trigger

Now I create a new Rule inside of Drip and configure the trigger to be:

Drip > Applied Tag admin-format_date-nmdd_challenge_evergreen

Step 5: Configure the Drip Custom Field Conversion

This is the secret sauce and, to be honest, it can get quite confusing. I’ll do my best to explain it.

What action do we want to perform? Set a person’s profile or custom field value

What we’re saying here is that when the tag is applied, we want to apply a value to a custom field.

Field (Which field are we setting a value for?) nmdd_challenge_start_date_formatted

Value (What is the actual value?)

{% assign parts = subscriber.nmdd_challenge_start_date | split: "/" %} {{ parts[2] }}-{{ parts[0] }}-{{ parts[1] }}

Value Liquid Language Explained

Placing that liquid code in the custom field value basically communicates “the result of this code is what I want to be stored as this value”.

assign parts = subscriber.nmdd_challenge_start_date

Assign means ‘store the data’. So you’re saying “what comes after the word ‘assign’ is what you want to store as the value”.

parts is the variable name I’ve assigned to hold the split data — you could name it anything. I’m calling it parts because it holds the individual parts of the date string. In this case the collection of data is referencing the back half of the code.

So far we’re saying “Hey, the value is going to be the data contained originally in the subscriber.nmdd_challenge_start_date field, organized by parts.”

The next part is ‘split’ which is a command that says “hey, you are seeing MM/DD/YYYY as one item. I want you to break up that single string of characters into multiple ‘parts’ that I can move around.”

Looking at the / that means “and I want you to create each part based upon the separating item of /”.

MM is part 0

DD is part 1

YYYY is part 2

Note: part numbering starts at 0, not 1. If your input format is different, the part numbers will shift accordingly.

The final part, {{ parts[2] }}-{{ parts[0] }}-{{ parts[1] }}, is basically saying “okay, now that you know what I want… which is the custom field broken up by parts, here is the order I want you to store it in.

Part 2 comes first

Place a – after Part 2

Part 0 comes next

Place a – after Part 0

Part 1 comes last

So in essence you now have MM/DD/YYYY broken into three parts, reordered and formatted to YYYY-MM-DD — the ISO 8601 format Drip requires for date-based workflow triggers.

What Happens After the Formatting

The end result winds up being something like 2025-01-15 stored in the field. The formatting all takes place instantly. You can see in the screenshot below what is left.

nmdd_challenge_start_date (top field) contains the original value with original formatting and nmdd_challenge_start_date_formatted (bottom field) contains the formatted version of the same value.

Step 6: Remove the Trigger Tag from the Profile

Finally, in the same rule I remove the tag used to trigger the rule, admin-format_date-nmdd_challenge_evergreen.

Why? If a user has a tag already assigned, it cannot be added, it can only be removed. This is a problem in the event the user decides they want to change their start date. By removing the tag as a part of the rule, if the user completes the form a second time, it will re-trigger the rule and update the start date to whatever the most recent selection is.

It’s a small housekeeping item that I use to prevent myself from having to actually do things manually.

A Note on the Liquid Date Filter

The split method above works by breaking a string apart and reassembling it in a new order. It’s the right tool when you’re reformatting a text value for storage in a custom field.

There’s a second liquid date technique worth knowing about: the | date: filter. This one works differently — it operates on values Drip already recognizes as timestamps, and uses strftime-style format codes to control the output.

For example:

{{ subscriber.custom_date | date: "%B %d, %Y" }}

This would output something like January 15, 2025 — which is useful for displaying a date inside an email body rather than storing it in a field for trigger purposes.

Common format codes:

  • %Y — four-digit year (2025)
  • %m — two-digit month (01–12)
  • %d — two-digit day (01–31)
  • %B — full month name (January)
  • %b — abbreviated month name (Jan)

If your platform stores dates as timestamps and you need to display them in a readable format inside an email, the | date: filter is the cleaner tool for that. The split method is what you need when you’re converting a string value into ISO 8601 format for a Drip workflow trigger.

Ask AI for Help

You may wonder, “Why would I not just go to AI to write this all for me?”

There are a few reasons.

First, you need to know what you want, specifically, so you can tell AI what snippet you’re trying to create. I knew that I needed to use Liquid to format, I knew that I needed the format to be a specific format, and I knew what format it was coming in as.

I also knew that I was assigning the original date format to x field and that I needed the newly formatted value in y field.

With this information I am able to clearly articulate my scenario into AI.

Another reason is that you should be familiar with the terminology. The exact formatting of liquid code varies from platform to platform. For instance, Keap, Klaviyo, Drip, and Shopify all use Liquid, but each one uses it slightly differently. Knowing the basics of the language will help you leverage Drip when using any program that leverages it, no matter the variance.

Another reason is in testing. AI is not going to be 100% perfect. If you can understand the basic syntax, you can either correct AI or fill in the blanks AI left when trying to configure the snippet. If you’re allowing a machine to do all your thinking, you’ll continue to be stupid at this stuff. You want to leverage AI, not rely on it.

Final Thoughts Using Liquid for Formatting Dates in Drip

The actual code I have used may need to be slightly altered depending on the app you’re using which incorporates Liquid. For instance, Klaviyo does not leverage the subscriber portion of the syntax used above. Keap will use subscriber and contact. Braze uses a similar liquid syntax for date display with minor structural differences. Shopify is where the language originated, so the | date: filter is most thoroughly documented there — and largely carries over to Drip.

Something else to be aware of is the fact that there are often multiple ways to achieve a specific need using Drip. This is the solution I have used and confirmed to work for me. If your situation is simpler — for instance, if your date is already in YYYY/MM/DD format and you just need to swap the separators — a single | replace: "/", "-" filter may be all you need rather than the full split approach.

If you need further explanation on how this works, feel free to paste this entire article into AI and ask AI to simplify it for you… ask specific questions. “I don’t understand this part. Can you clarify what the writer means?” This will help you better understand the concepts explained as well as allow you to ask AI to explain further detail, customizing the outputs in such a way that make sense to you.

Liquid is powerful and I urge you to try experimenting in all sorts of ways!

Frequently Asked Questions

Why does Drip require ISO 8601 format for date-based workflow triggers?

Drip’s workflow engine reads date-type custom fields as timestamps internally. ISO 8601 (YYYY-MM-DD) is the format Drip uses to recognize a value as a date rather than a plain text string. When a custom field is written in the correct ISO format, a calendar icon appears next to it in the subscriber profile — that’s your confirmation that Drip is treating it as a date. Without that, date-based triggers won’t fire.

What’s the difference between the split method and the | date: filter?

The split method breaks a text string apart by a separator character and reassembles the pieces in a new order. It works on any string value, regardless of whether Drip recognizes it as a date. The | date: filter works on values Drip already recognizes as timestamps — it’s used primarily for display formatting inside email bodies, not for reformatting a value for storage. If you’re trying to convert MM/DD/YYYY to YYYY-MM-DD for use in a workflow trigger, split is the right tool. If you’re trying to display a date as “January 15, 2025” inside an email, | date: is the right tool.

Will this same Liquid code work in Klaviyo or Keap?

The logic is the same but the syntax differs. Klaviyo does not use the subscriber. prefix — you’d reference the field directly. Keap uses both subscriber and contact depending on the context. Always check the Liquid documentation for your specific platform before copying code between systems.

Does the Drip Rule fire immediately after the tag is applied?

In most cases yes — Rules in Drip fire quickly after the trigger condition is met. However, Drip schedules date-based workflow triggers up to 30 minutes in advance. If a custom field is updated less than 30 minutes before the specified trigger date, the workflow may not fire on time. For date-based workflows, make sure the formatted field is being set well in advance of the intended start date.

Webinar Sample Ad Copy, Campaign Donut

Complete Webinar Kit from Campaign Donut

Build A Webinar Campaign In Record Time

Customize our proven templates with your details and hit the ground running. You don’t have to start from scratch. Just add your details and start promoting!

For a limited time get Campaign Donut for free

Want to Try Campaign Donut?

We’ll send you a complimentary promotional code. With it, you can enjoy a 30-day trial of Campaign Donut, absolutely free!

Check your email inbox or spam folder for your promotional code.