countdown

Privateunrated

Content

17 lines
{=(d2cd2):{args(1)}}{=(comment):this is the day of the week to count down to, first letter capitalized, spelled correctly in English}
{=(t2cd2f24h):{args(2)}}{=(comment):this is the time of that day to count down to, in 24h format, HH:MM, 00:00-23:59}
{=(offset):{args(3)}}{=(comment):this is your timezone's UTC offset}

{=(comment):The following variable just converts the t2cd2f24h to 12h format for the embed title, you can change the PM/AM at the end to lowercase if you wish.}
{=(t2cd2f12h):{if({t2cd2f24h(1)::}>12):{m:trunc({t2cd2f24h(1)::}-12)}|{if({t2cd2f24h(1)::}==00):12|{t2cd2f24h(1)::}}}:{t2cd2f24h(2)::} {if({t2cd2f24h(1)::}>=12):PM|AM}}

{=(comment):Please don't touch anything below, time math is very complex}
{=(osunix):{m:trunc({unix}+({offset}*3600))}}
{=(crntDayepoch4t2cd2):{m:trunc({strf({strf({osunix}):%F} {t2cd2f24h}:{strf({osunix}):%S}):%s}+({offset}*-3600))}}

{=(day):86400}
{=(DotW):{strf({m:trunc({osunix}+({day}*0))}):%A} {strf({m:trunc({osunix}+({day}*1))}):%A} {strf({m:trunc({osunix}+({day}*2))}):%A} {strf({m:trunc({osunix}+({day}*3))}):%A} {strf({m:trunc({osunix}+({day}*4))}):%A} {strf({m:trunc({osunix}+({day}*5))}):%A} {strf({m:trunc({osunix}+({day}*6))}):%A}}
{=(d2cd2index):{index({d2cd2}):{DotW}}}

{=(dt2cd2epoch):{strf({m:trunc({crntDayepoch4t2cd2}+({d2cd2index}*{day}))}):%s}}
{=(output):td:{strf({if({unix}<={dt2cd2epoch}):{dt2cd2epoch}|{m:trunc({dt2cd2epoch}+({day}*7))}}):%F %T}}

Embed

1 line
{"color": 10038562, "title": "Countdown to {d2cd2} at {t2cd2f12h}", "author": {"name": "{server}", "icon_url": "{server(icon)}"}, "footer": {"text": "Command: +Countdown [Day of the week] [Hour] [Timezone] "}, "description": "{{output}}"}
Raw JSON
{
  "id": 120375,
  "created_at": "2020-02-15T22:31:01.000Z",
  "tag_name": "countdown",
  "nsfw": false,
  "owner_id": "283749204487045132",
  "uses": 24,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "625096825141198888",
  "sharer": "283749204487045132",
  "content": "{=(d2cd2):{args(1)}}{=(comment):this is the day of the week to count down to, first letter capitalized, spelled correctly in English}\n{=(t2cd2f24h):{args(2)}}{=(comment):this is the time of that day to count down to, in 24h format, HH:MM, 00:00-23:59}\n{=(offset):{args(3)}}{=(comment):this is your timezone's UTC offset}\n\n{=(comment):The following variable just converts the t2cd2f24h to 12h format for the embed title, you can change the PM/AM at the end to lowercase if you wish.}\n{=(t2cd2f12h):{if({t2cd2f24h(1)::}>12):{m:trunc({t2cd2f24h(1)::}-12)}|{if({t2cd2f24h(1)::}==00):12|{t2cd2f24h(1)::}}}:{t2cd2f24h(2)::} {if({t2cd2f24h(1)::}>=12):PM|AM}}\n\n{=(comment):Please don't touch anything below, time math is very complex}\n{=(osunix):{m:trunc({unix}+({offset}*3600))}}\n{=(crntDayepoch4t2cd2):{m:trunc({strf({strf({osunix}):%F} {t2cd2f24h}:{strf({osunix}):%S}):%s}+({offset}*-3600))}}\n\n{=(day):86400}\n{=(DotW):{strf({m:trunc({osunix}+({day}*0))}):%A} {strf({m:trunc({osunix}+({day}*1))}):%A} {strf({m:trunc({osunix}+({day}*2))}):%A} {strf({m:trunc({osunix}+({day}*3))}):%A} {strf({m:trunc({osunix}+({day}*4))}):%A} {strf({m:trunc({osunix}+({day}*5))}):%A} {strf({m:trunc({osunix}+({day}*6))}):%A}}\n{=(d2cd2index):{index({d2cd2}):{DotW}}}\n\n{=(dt2cd2epoch):{strf({m:trunc({crntDayepoch4t2cd2}+({d2cd2index}*{day}))}):%s}}\n{=(output):td:{strf({if({unix}<={dt2cd2epoch}):{dt2cd2epoch}|{m:trunc({dt2cd2epoch}+({day}*7))}}):%F %T}}",
  "embed": "{\"color\": 10038562, \"title\": \"Countdown to {d2cd2} at {t2cd2f12h}\", \"author\": {\"name\": \"{server}\", \"icon_url\": \"{server(icon)}\"}, \"footer\": {\"text\": \"Command: +Countdown [Day of the week] [Hour] [Timezone] \"}, \"description\": \"{{output}}\"}",
  "last_fetched": "2026-10-20T20:56:45.684Z"
}