that is working, but if i try to format this. i always got error. i just want the year, so i thougt i usw:
$(countdown 9 26 2020 00:00:00 AM Europe/Berlin "YY") but whatever i tryed, no formating works.
can pls someone help ?
8 replies
Quirky Fox
As far as I know there is no way to format the countdown, but it may be possible with the use of an eval to check just the year. But it would be pretty complicated. I can try to work something out if you really want this.
Polar Cat
Hey @Dizzy Wolf!
To count from a date into the future, you should use $(countup) instead of $(countdown). As explained in the documentation: • countdown: use the variable to create commands that display the time left until a specified date. • countup: use the variable to create commands that display the time since a specified date.
Now that this issue is out of the way, let's see how to do what you're looking for:
$(eval y=`$(countup 09 26 1979 00:00:00 AM Europe/Berlin)`.split(` `);y.length=2;y.join(` `);)
With this you'll get XX years as a result. If you wish to only have XX, replace ``y.length=2;y.join();` with y[0];`, like this:
$(eval y=`$(countup 09 26 1979 00:00:00 AM Europe/Berlin)`.split(` `);y[0];)
Dizzy Wolf
thx you for your help 🙂
is it posible to set the date by the user like in this way?
ah thank you very much. so as far as i understand, its not posible to change the string in the $(countup) so a secound command is used to transform the insert query in a new query for a subcommand
Polar Cat
Short answer is yes, long answer is a bit more complicated, it's technically possible, but we can't do too many manipulations or it breaks.
Didn't find your answer? The community is on Discord.