datecalc
Privateunrated
Content
117 lines{=(comment):fill in the following stuff without fail}
{=(prefix):!}
{=(tagname):datecalc}
{=(offset):5.5}
{=(comment):all the different args}
{=(jargs):{replace(|,~):{args}}}
{=(arg1):{list(0):{jargs}}}
{=(arg2):{list(1):{jargs}}}
{=(arg3):{list(2):{jargs}}}
{=(arg4):{list(3):{jargs}}}
{=(arg5):{list(4):{jargs}}}
{=():}
{=(args):{args(1):|}}
{=(comment):Performing all the checks and functions to make sure everything is in order}
{=(isnum?):{in(true):{in({m:sgn({replace(/,abc):{args}})}):1}}}
{=(arglen):{index(!@#):{args} !@#}}
{=(fullarglength):{index(!@#):{replace(, ):{args}} !@#}}
{=(newarglen):{index(!@#):{replace(/,. .):{args}} !@#}}
{=(slashcount):{m:trunc({newarglen}-{arglen})}}
{=(first.slash.arg.len):{index(!@#):{replace(, ):{args(1):/}} !@#}}
{=(second.slash.arg.len):{index(!@#):{replace(, ):{args(2):/}} !@#}}
{=(third.slash.arg.len):{index(!@#):{replace(, ):{args(3):/}} !@#}}
{=(arg3len):{index(!@#):{replace(, ):{arg3}} !@#}}
{=(checks):{slashcount} {arglen} {fullarglength} {isnum?} {first.slash.arg.len} {second.slash.arg.len} {third.slash.arg.len}}
{=(COMMENT):Checking the format of the entry}
{=(format):{replace({checks},format not matched):{replace({checks(+3)} true {checks(-2+)},unix):{replace(0 3 {checks(3+)},normal):{replace(2 1 5 {checks(4)} 1 1 1,ddmmyy):{replace(2 1 6 {checks(4)} 1 1 2,ddmmyy):{replace(2 1 7 {checks(4)} 2 1 1,ddmmyy):{replace(2 1 8 {checks(4)} 2 2 2,ddmmyy):{replace(2 1 6 {checks(4)} 1 2 2,ddmmyy):{replace(2 1 6 {checks(4)} 1 2 1,ddmmyy):{replace(2 1 10 {checks(4)} 2 2 4,ddmmyyyy):{replace(2 1 9 {checks(4)} 2 1 4,ddmmyyyy):{replace(2 1 8 {checks(4)} 1 1 4,ddmmyyyy):{replace(2 1 9 {checks(4)} 1 2 4,ddmmyyyy):{checks}}}}}}}}}}}}}}}
{=(comment):calculating the year}
{=(yearcheck):{replace(format not matched,):{replace(unix,):{replace(normal,{args(3)}):{replace(ddmmyy,{args(3):/}):{replace(ddmmyyyy,{args(3):/}):{format}}}}}}}
{=(yearlen):{index(!@#):{replace(, ):{yearcheck}} !@#}}
{=(year):{replace({yearlen}k,year not matched):{replace(1k,200{yearcheck}):{replace(2k,20{yearcheck}):{replace(4k,{yearcheck}):{yearlen}k}}}}}
{=(comment):calculating the month}
{=(montharg):{{replace(false,):{replace(true,args(2)):{in(normal):{format(1)}}}}}}
{=(months):january february march april may june july august september october november december}
{=(monthinfo):{replace(true,):{index({montharg}):{replace({montharg},, {montharg} .):{months}}}{in({montharg}):{months}}}}
{=(month):{replace(ddmmyy,{args(2):/}):{replace(ddmmyyyy,{args(2):/}):{replace(normal,{monthinfo}):{format}}}}}
{=(monthlen):{index(!@#):{replace(, ):{month}} !@#}}
{=(month):{replace({monthlen}k,month not matched):{replace(1k,0{month}):{replace(2k,{month}):{monthlen}k}}}}
{=(comment):calculating the date}
{=(date):{replace(ddmmyy,{args(1):/}):{replace(ddmmyyyy,{args(1):/}):{replace(normal,{1}):{format}}}}}
{=(datelen):{index(!@#):{replace(, ):{date}} !@#}}
{=(date):{replace({datelen}k,date not matched):{replace(1k,0{date}):{replace(2k,{date}):{datelen}k}}}}
{=(comment):all the final stuff}
{=(finaldate):{year}-{month}-{date} 00:00:00}
{=(unix1):{m:trunc({strf({finaldate}):%s}+(3600*{offset}))}}
{=(finalunix1):{replace({format},):{replace(unix,{args}):{format}}}{replace(true,{unix1}):{replace(false,):{in(true):{in({m:sgn({replace(/,abc):{unix1}})}):1}}}}}
{=(servercreationunix):{strf({server(created_at)}):%s}}
{=(diff.finalunix.servercreation):{m:sgn({finalunix1}-{servercreationunix})}}
{=(serverid):{replace({arg3len}k,{server(id)}):{replace(18k,{arg3}):{arg3len}k}}}
{=(diff.discordepooch):{m:sgn({finalunix1}-1431561600)}}
{=(diff.finalunix.servercreation):{replace({serverid},1):{replace({server(id)},{m:sgn({finalunix1}-{servercreationunix})}):{serverid}}}}
{=(diff.currentunix):{m:sgn({unix}-{finalunix1})}}
{=(checks2):k{diff.discordepooch} k{diff.finalunix.servercreation} k{diff.currentunix}}
{=(finalunix):{replace({checks2},error):{replace(k1 k1 k1,{finalunix1}):{checks2}}}}
{=(finalunixwithoutoffset):{m:trunc({finalunix}-(3600*{offset}))}}
__Debug__
finalunix1: {finalunix1}
diff.discordepooch: {diff.discordepooch}
checks2: {checks2}
final unix: {finalunix} [<t:{finalunix}>]
{=(comment):finding the links to the messages and the channels ids}
{=(messageidcalc):{m:trunc(({finalunix}*1000-1420070400000)*(2^22))}}
{=(messageid):{replace({fullarglength}k,{messageidcalc}):{replace(0k,6942069420):{fullarglength}k}}}
{=(arg2len):{index(!@#):{replace(, ):{arg2}} !@#}}
{=(arg3len):{index(!@#):{replace(, ):{arg3}} !@#}}
{=(channelid):{replace({arg2len}k,{channel(id)}):{replace(18k,{arg2}):{arg2len}k}}}
{=(messagelink):https://discord.com/channels/{serverid}/{channelid}/{messageid}}
{=(comment):embed stuff}
{=(p):{prefix}}
{=(i.help):7289DA~Help Center~**Features of the tag**
<:div_replylineblue:910527247658647563>
<:div_replycontblue:910527294240587836> What the tag basically does is, takes your input, formats it, and gives you the
<:div_replylineblue:910527247658647563> **Message Link** where the message at that time should *technically* lie. It won't
<:div_replylineblue:910527247658647563> be an exact message link but it would be enough to take you to that position!
<:div_replylineblue:910527247658647563>
<:div_replycontblue:910527294240587836> **Supports multiple formats** as input. For example, you can do
<:div_replylineblue:910527247658647563> `{p}{tagname} 10 Jan 2021`, `{p}{tagname} 10/1/2021` `{p}{tagname} 10/1/21`
<:div_replylineblue:910527247658647563> and some more!
<:div_replylineblue:910527247658647563>
<:div_replycontblue:910527294240587836> **Uses subscript matching for the month** when inputting this:
<:div_replylineblue:910527247658647563> `{p}{tagname} 10 Jan 2021`. It essentially means it will give the correct result
<:div_replylineblue:910527247658647563> if you do `{p}{tagname} 10 j 2021` for example 👀
<:div_replylineblue:910527247658647563>
<:div_replycontblue:910527294240587836> You can **input a channel and the server in the tag input itself** and it will
<:div_replylineblue:910527247658647563> give you the message link for that channel and/or the server. For example, you
<:div_replylineblue:910527247658647563> could do `{p}{tagname} 29 Jan 2021|186980582863929345|186980582863929345`
<:div_replylineblue:910527247658647563> and it will lead you to the first message on 29th of January in the channel
<:div_replylineblue:910527247658647563> with `186980582863929345` as its ID and `186980582863929345` as its server ID
<:div_replyblue:910527342806450197> If you don't input any time, it will lead you to **the first message in the channel**!}
{=(i.data):FD8F0E~Timestamp to Message Convertor!~The calculated time was <t:{finalunixwithoutoffset}>!
<:div_replycontblue:910527294240587836> The message link to the above time leads you [here]({messagelink} "Click me").
<:div_replycontblue:910527294240587836> For those who can't see the above link, there you go: {messagelink}}
{=(i.error):BE4CB5~Error~Looks like one of the below things happened:
<:div_replycontblue:910527294240587836> The coding was done incorrectly causing the tag to fail using the input [Unlikely]
<:div_replylineblue:910527247658647563>
<:div_replycontblue:910527294240587836> the input was incorrect! Please make sure that it is of the format
<:div_replylineblue:910527247658647563> `{p}{tagname} 2/3/2021|CHANNEL_ID|SERVER_ID` where both of the channel id and
<:div_replylineblue:910527247658647563> the server id are optional!
<:div_replylineblue:910527247658647563>
<:div_replyblue:910527342806450197> Please ensure that the input you are providing is **after Discord was made, after the server was created and before the current time!**}
{=(i.info):{{replace(false,i.data):{replace(true,i.error):{in(error):{finalunix}}}}}}
{=(em.data):{{replace(false,i.info):{replace(true,i.help):{in(help):{1}}}}}}
{=(em.color):{em.data(1):~}}
{=(em.title):{em.data(2):~}}
{=(em.desc):{em.data(3):~}}
{embed(color):#{em.color}}Embed
1 line{"color": 5198940, "title": "{em.title}", "author": {"name": "{user}", "icon_url": "{user(avatar)}"}, "footer": {"text": "Type {p}{tagname} help for help"}, "description": "{em.desc}"}Raw JSON
{
"id": 1153194,
"created_at": "2021-11-16T03:14:03.000Z",
"tag_name": "datecalc",
"nsfw": false,
"owner_id": "823904633944539196",
"uses": 179,
"description": null,
"restricted": false,
"shared": false,
"deleted": false,
"safe": "unrated",
"hidden": false,
"guild_id": "831515159893770270",
"sharer": "823904633944539196",
"content": "{=(comment):fill in the following stuff without fail}\n{=(prefix):!}\n{=(tagname):datecalc}\n{=(offset):5.5}\n\n{=(comment):all the different args}\n{=(jargs):{replace(|,~):{args}}}\n{=(arg1):{list(0):{jargs}}}\n{=(arg2):{list(1):{jargs}}}\n{=(arg3):{list(2):{jargs}}}\n{=(arg4):{list(3):{jargs}}}\n{=(arg5):{list(4):{jargs}}}\n{=():}\n\n{=(args):{args(1):|}}\n{=(comment):Performing all the checks and functions to make sure everything is in order}\n{=(isnum?):{in(true):{in({m:sgn({replace(/,abc):{args}})}):1}}}\n{=(arglen):{index(!@#):{args} !@#}}\n{=(fullarglength):{index(!@#):{replace(, ):{args}} !@#}}\n{=(newarglen):{index(!@#):{replace(/,. .):{args}} !@#}}\n{=(slashcount):{m:trunc({newarglen}-{arglen})}}\n{=(first.slash.arg.len):{index(!@#):{replace(, ):{args(1):/}} !@#}}\n{=(second.slash.arg.len):{index(!@#):{replace(, ):{args(2):/}} !@#}}\n{=(third.slash.arg.len):{index(!@#):{replace(, ):{args(3):/}} !@#}}\n{=(arg3len):{index(!@#):{replace(, ):{arg3}} !@#}}\n{=(checks):{slashcount} {arglen} {fullarglength} {isnum?} {first.slash.arg.len} {second.slash.arg.len} {third.slash.arg.len}}\n\n{=(COMMENT):Checking the format of the entry}\n{=(format):{replace({checks},format not matched):{replace({checks(+3)} true {checks(-2+)},unix):{replace(0 3 {checks(3+)},normal):{replace(2 1 5 {checks(4)} 1 1 1,ddmmyy):{replace(2 1 6 {checks(4)} 1 1 2,ddmmyy):{replace(2 1 7 {checks(4)} 2 1 1,ddmmyy):{replace(2 1 8 {checks(4)} 2 2 2,ddmmyy):{replace(2 1 6 {checks(4)} 1 2 2,ddmmyy):{replace(2 1 6 {checks(4)} 1 2 1,ddmmyy):{replace(2 1 10 {checks(4)} 2 2 4,ddmmyyyy):{replace(2 1 9 {checks(4)} 2 1 4,ddmmyyyy):{replace(2 1 8 {checks(4)} 1 1 4,ddmmyyyy):{replace(2 1 9 {checks(4)} 1 2 4,ddmmyyyy):{checks}}}}}}}}}}}}}}}\n\n{=(comment):calculating the year}\n{=(yearcheck):{replace(format not matched,):{replace(unix,):{replace(normal,{args(3)}):{replace(ddmmyy,{args(3):/}):{replace(ddmmyyyy,{args(3):/}):{format}}}}}}}\n{=(yearlen):{index(!@#):{replace(, ):{yearcheck}} !@#}}\n{=(year):{replace({yearlen}k,year not matched):{replace(1k,200{yearcheck}):{replace(2k,20{yearcheck}):{replace(4k,{yearcheck}):{yearlen}k}}}}}\n\n{=(comment):calculating the month}\n{=(montharg):{{replace(false,):{replace(true,args(2)):{in(normal):{format(1)}}}}}}\n{=(months):january february march april may june july august september october november december}\n{=(monthinfo):{replace(true,):{index({montharg}):{replace({montharg},, {montharg} .):{months}}}{in({montharg}):{months}}}}\n{=(month):{replace(ddmmyy,{args(2):/}):{replace(ddmmyyyy,{args(2):/}):{replace(normal,{monthinfo}):{format}}}}}\n{=(monthlen):{index(!@#):{replace(, ):{month}} !@#}}\n{=(month):{replace({monthlen}k,month not matched):{replace(1k,0{month}):{replace(2k,{month}):{monthlen}k}}}}\n\n{=(comment):calculating the date}\n{=(date):{replace(ddmmyy,{args(1):/}):{replace(ddmmyyyy,{args(1):/}):{replace(normal,{1}):{format}}}}}\n{=(datelen):{index(!@#):{replace(, ):{date}} !@#}}\n{=(date):{replace({datelen}k,date not matched):{replace(1k,0{date}):{replace(2k,{date}):{datelen}k}}}}\n\n{=(comment):all the final stuff}\n{=(finaldate):{year}-{month}-{date} 00:00:00}\n{=(unix1):{m:trunc({strf({finaldate}):%s}+(3600*{offset}))}}\n{=(finalunix1):{replace({format},):{replace(unix,{args}):{format}}}{replace(true,{unix1}):{replace(false,):{in(true):{in({m:sgn({replace(/,abc):{unix1}})}):1}}}}}\n{=(servercreationunix):{strf({server(created_at)}):%s}}\n{=(diff.finalunix.servercreation):{m:sgn({finalunix1}-{servercreationunix})}}\n{=(serverid):{replace({arg3len}k,{server(id)}):{replace(18k,{arg3}):{arg3len}k}}}\n{=(diff.discordepooch):{m:sgn({finalunix1}-1431561600)}}\n{=(diff.finalunix.servercreation):{replace({serverid},1):{replace({server(id)},{m:sgn({finalunix1}-{servercreationunix})}):{serverid}}}}\n{=(diff.currentunix):{m:sgn({unix}-{finalunix1})}}\n{=(checks2):k{diff.discordepooch} k{diff.finalunix.servercreation} k{diff.currentunix}}\n{=(finalunix):{replace({checks2},error):{replace(k1 k1 k1,{finalunix1}):{checks2}}}}\n{=(finalunixwithoutoffset):{m:trunc({finalunix}-(3600*{offset}))}}\n__Debug__\nfinalunix1: {finalunix1}\ndiff.discordepooch: {diff.discordepooch}\nchecks2: {checks2}\nfinal unix: {finalunix} [<t:{finalunix}>]\n\n{=(comment):finding the links to the messages and the channels ids}\n{=(messageidcalc):{m:trunc(({finalunix}*1000-1420070400000)*(2^22))}}\n{=(messageid):{replace({fullarglength}k,{messageidcalc}):{replace(0k,6942069420):{fullarglength}k}}}\n{=(arg2len):{index(!@#):{replace(, ):{arg2}} !@#}}\n{=(arg3len):{index(!@#):{replace(, ):{arg3}} !@#}}\n{=(channelid):{replace({arg2len}k,{channel(id)}):{replace(18k,{arg2}):{arg2len}k}}}\n{=(messagelink):https://discord.com/channels/{serverid}/{channelid}/{messageid}}\n\n\n{=(comment):embed stuff}\n{=(p):{prefix}}\n{=(i.help):7289DA~Help Center~**Features of the tag**\n<:div_replylineblue:910527247658647563>\n<:div_replycontblue:910527294240587836> What the tag basically does is, takes your input, formats it, and gives you the\n<:div_replylineblue:910527247658647563> **Message Link** where the message at that time should *technically* lie. It won't \n<:div_replylineblue:910527247658647563> be an exact message link but it would be enough to take you to that position!\n<:div_replylineblue:910527247658647563>\n<:div_replycontblue:910527294240587836> **Supports multiple formats** as input. For example, you can do \n<:div_replylineblue:910527247658647563> `{p}{tagname} 10 Jan 2021`, `{p}{tagname} 10/1/2021` `{p}{tagname} 10/1/21` \n<:div_replylineblue:910527247658647563> and some more!\n<:div_replylineblue:910527247658647563>\n<:div_replycontblue:910527294240587836> **Uses subscript matching for the month** when inputting this: \n<:div_replylineblue:910527247658647563> `{p}{tagname} 10 Jan 2021`. It essentially means it will give the correct result\n<:div_replylineblue:910527247658647563> if you do `{p}{tagname} 10 j 2021` for example 👀\n<:div_replylineblue:910527247658647563>\n<:div_replycontblue:910527294240587836> You can **input a channel and the server in the tag input itself** and it will \n<:div_replylineblue:910527247658647563> give you the message link for that channel and/or the server. For example, you\n<:div_replylineblue:910527247658647563> could do `{p}{tagname} 29 Jan 2021|186980582863929345|186980582863929345`\n<:div_replylineblue:910527247658647563> and it will lead you to the first message on 29th of January in the channel \n<:div_replylineblue:910527247658647563> with `186980582863929345` as its ID and `186980582863929345` as its server ID\n<:div_replyblue:910527342806450197> If you don't input any time, it will lead you to **the first message in the channel**!}\n{=(i.data):FD8F0E~Timestamp to Message Convertor!~The calculated time was <t:{finalunixwithoutoffset}>! \n<:div_replycontblue:910527294240587836> The message link to the above time leads you [here]({messagelink} \"Click me\"). \n<:div_replycontblue:910527294240587836> For those who can't see the above link, there you go: {messagelink}}\n{=(i.error):BE4CB5~Error~Looks like one of the below things happened:\n\n<:div_replycontblue:910527294240587836> The coding was done incorrectly causing the tag to fail using the input [Unlikely]\n<:div_replylineblue:910527247658647563>\n<:div_replycontblue:910527294240587836> the input was incorrect! Please make sure that it is of the format \n<:div_replylineblue:910527247658647563> `{p}{tagname} 2/3/2021|CHANNEL_ID|SERVER_ID` where both of the channel id and \n<:div_replylineblue:910527247658647563> the server id are optional!\n<:div_replylineblue:910527247658647563>\n<:div_replyblue:910527342806450197> Please ensure that the input you are providing is **after Discord was made, after the server was created and before the current time!**}\n{=(i.info):{{replace(false,i.data):{replace(true,i.error):{in(error):{finalunix}}}}}}\n{=(em.data):{{replace(false,i.info):{replace(true,i.help):{in(help):{1}}}}}}\n{=(em.color):{em.data(1):~}}\n{=(em.title):{em.data(2):~}}\n{=(em.desc):{em.data(3):~}}\n\n{embed(color):#{em.color}}",
"embed": "{\"color\": 5198940, \"title\": \"{em.title}\", \"author\": {\"name\": \"{user}\", \"icon_url\": \"{user(avatar)}\"}, \"footer\": {\"text\": \"Type {p}{tagname} help for help\"}, \"description\": \"{em.desc}\"}",
"last_fetched": "2026-10-20T18:01:25.723Z"
}