All Collections
Advanced
Changing the date and time format in notifications
Changing the date and time format in notifications

Change the date and time format in Shopify email notifications

Clemency Farmer avatar
Written by Clemency Farmer
Updated over a week ago

You can modify the format of the pickup/delivery/shipping date and time in your email notifications by adding code to your templates.

Create a backup of your current email templates before making any changes.


Requirements


Change the date format

By default, your date will be in the format "Day, date month year"—for example,

"Sunday, 1 January 2023". The day and month cannot be translated into other languages, but you can change the format to only include numbers.

  1. In your Shopify Settings go to Notifications. Open the email template you would like to modify, like the Order Confirmation template.

  2. Click Edit code.

  3. Find the following liquid variable that shows the customer's pickup date:

    {{ attributes.Pickup-Date

  4. Replace the above code with the following line:

    {{ attributes.Pickup-Date | date: "%A, %-d %B %Y" }}

  5. Use strftime.net to get your preferred date format

    • Example: %d/%m/%Y will display the date in DD/MM/YYYY format.

  6. Replace the code between the quote marks " " with your preferred date format.

    • Example: "%A, %d/%m/%Y"

Repeat these steps on the liquid variables for the local delivery and shipping dates as required. A full list of available liquid variables for Zapiet - Pickup + Delivery can be found in our Liquid variable reference guide.

Use the attributes below to find the local delivery and shipping date formats.

  • Local Delivery date

    {{ attributes.Delivery-Date 

  • Shipping date

    {{ attributes.Shipping-Date 

Change the time format

The pickup time by default shows as 24-hour times, whereas delivery will show as the setting chosen in Zapiet - Pickup + Delivery > Settings > Standards and formats.

  1. In your Shopify Settings go to Notifications. Open the email template you would like to modify, like the Order Confirmation template.

  2. Click Edit code.

  3. Find the following liquid variable that shows the customer's pickup time:

    {{ attributes.Pickup-Time 

  4. Replace this code with the following line:

    {{ attributes.Pickup-Time | date: "%r" }}

  5. The small letter 'r' will format the time to appear in the 12-hour format. To make it appear in the 24-hour format the capital 'R' is used instead.

Repeat these steps on the liquid variables for the local delivery time as required. A full list of available liquid variables for Zapiet - Pickup + Delivery can be found in our Liquid variable reference guide.

Use the attributes below to find the local delivery and shipping date formats.

  • Local Delivery date

    {{ attributes.Delivery-Date 

  • Shipping date

    {{ attributes.Shipping-Date 

Note

The delivery time will show in the same format as is set in your standards and formats setting. If you'd like to modify it, you can use this code to convert the standard.

{% assign deliveryTime = attributes.Delivery-Time | split: "- " %}
{% assign start = deliveryTime.first | date: "%r" %}
{% assign end = deliveryTime.last | date: "%r" %}
Delivery Time: {{ start }} - {{ end }}

The small letter 'r' will format the time to appear in the 12-hour format. To make it appear in the 24-hour format the capital 'R' is used instead.

Did this answer your question?