Skip to main content
Contributor I
October 18, 2023
Solved

Calculate a date prior to a date in an event

  • October 18, 2023
  • 1 reply
  • 252 views

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!

    This topic has been closed for replies.
    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
    Klaviyo Alum
    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!

    -Stephen