Skip to main content
Solved

Calculate a date prior to a date in an event

  • October 18, 2023
  • 1 reply
  • 228 views

Forum|alt.badge.img+2

Hi - I’m looking to calculate a date prior to a date in an event. I know how to use “later” to come up with a future date but i’m looking to get a prior date. For example my event shows the date an upcoming order will be placed. I want to use that date minus 1 day to say you have until X date to edit your order. 

 

Thanks!

Best answer by stephen.trumble

Hey @kdoherty 

Welcome to the community and congrats on your first post! Happy to help!

You should be able to try something like:
{{ variable_name '%Y-%m-%d' as expiration }}{{ expiration|days_later:-1 }}

You would just need to change variable_name to whatever the property is.

Let me know if this works for you!

1 reply

stephen.trumble
Forum|alt.badge.img+60
  • Klaviyo Alum
  • 1515 replies
  • Answer
  • October 19, 2023

Hey @kdoherty 

Welcome to the community and congrats on your first post! Happy to help!

You should be able to try something like:
{{ variable_name '%Y-%m-%d' as expiration }}{{ expiration|days_later:-1 }}

You would just need to change variable_name to whatever the property is.

Let me know if this works for you!