Skip to main content
Solved

Dynamic date in liquid countdown function issues


Hey community,

I have an issue with the following liquid code where I’m basically trying to calculate a future date for a countdown timer in one of my campaigns.

 

{% assign tomorrow = "now" | date: "%s" | plus: 86400 | date: "%Y-%m-%d 23:59:59" %}

{% countdown point:15 time:"{{ tomorrow }} (GMT)" fg:07182b bg:f9f9fb font:"Helvetica Neue" weight:normal resolution:S frames:60 %} 

This gives me the error 

countdown: time attribute must be in the form 2006-01-02 15:04:05 (MST), line:13, col:1

 

However, this code works well;

{% countdown point:15 time:"2026-01-25 23:59:59 (GMT)" fg:07182b bg:f9f9fb font:"Helvetica Neue" weight:normal resolution:S frames:60 %} 

 

I have very limited liquid experience but from best guessing I think either the variable “tomorrow” has the wrong variable type (datetime vs string?) or that I’m adding it to the countdown function the wrong way.

 

Any help would be much appreciated. Have tried to get this working for ages now!

 

Many thanks in advance!

Best answer by Felix

Hey Balthazar,

maybe you have seen the docs here. In the “time” section it is stated that Liquid is not accepted, but your {{ tomorrow }} is a Liquid variable.

I am afraid you will have to work without the countdown timer…

 

Hope that helps,

Felix

View original
Did this topic help you find an answer to your question?

2 replies

Felix
  • Novice
  • 223 replies
  • Answer
  • January 29, 2025

Hey Balthazar,

maybe you have seen the docs here. In the “time” section it is stated that Liquid is not accepted, but your {{ tomorrow }} is a Liquid variable.

I am afraid you will have to work without the countdown timer…

 

Hope that helps,

Felix


  • Author
  • Novice
  • 1 reply
  • February 11, 2025

Thanks a lot for clarifying Felix! 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings