timestamp

Privateunrated

Content

39 lines
{=(COMMENT):This converts all arguments to lower case, so it doesn't matter how the user types them}
{=(d):{lower:{1}}}
{=(h):{lower:{2}}}
{=(m):{lower:{3}}}

{=(COMMENT):This removes the duration marking from the argument, preparing it for the maths calculations}
{=(days):{replace(d,):{d}}}
{=(hours):{replace(h,):{h}}}
{=(minutes):{replace(m,):{m}}}

{=(COMMENT):In case you were ever curious, this is how many seconds are in a day, hour, or minute}
{=(days.second):86400}
{=(hours.second):3600}
{=(minutes.second):60}

{=(COMMENT):Now we get to the maths}
{=(d.secs):{m:{days}*{days.second}}}
{=(h.secs):{m:{hours}*{hours.second}}}
{=(m.secs):{m:{minutes}*{minutes.second}}}

{=(total.seconds):{m:{d.secs}+{h.secs}+{m.secs}}}

{=(COMMENT):This checks that they input the arguments in the correct order}
{=(d.1):{in(d):{d}}}
{=(h.2):{in(h):{h}}}
{=(m.3):{in(m):{m}}}

{=():}
{=(COMMENT):Output control}
{=(input.correct):{or({d.1}==false|{h.2}==false|{m.3}==false):false|true}}

{=(time):{m:trunc({m:{unix}+{m:trunc({total.seconds})}})}}
{=(error):You did not imput the correct format, please imput `xd yh zm`}

{=(embed):c:cembed {"fields":[{"name":"Short Time","value":"<t:{time}:t>\n\\<t:{time}:t>","inline":true},{"name":"Long Time","value":"<t:{time}:T>\n\\<t:{time}:T>","inline":true},{"name":"Short Date","value":"<t:{time}:d>\n\\<t:{time}:d>","inline":true},{"name":"Long Date","value":"<t:{time}:D>\n\\<t:{time}:D>","inline":true},{"name":"Long Date w/ Short Time","value":"<t:{time}:f>\n\\<t:{time}:f>","inline":true},{"name":"Long Date w/ Day of The Week & Short Time","value":"<t:{time}:F>\n\\<t:{time}:F>","inline":true},{"name":"Relative","value":"<t:{time}:R>\n\\<t:{time}:R>","inline":true}],"title":"Unix Timestamp Formats ","description":"this provides quick examples of all the different Unix Timestamps available in Discord.","color":16081645,"footer":{"icon_url":"https://images-ext-1.discordapp.net/external/MeDzvf3aNzyv2btDSkFTnX_BRwddzj0fTlhvfFFVXso/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/857254633763241984/94d230f6a296fa22084c6d7accdeea80.png","text":"Quick Timestamp 9+10=21"}}}

{=(COMMENT):The actual output, this checks that they input the correct arguments, and then either tells them the correct way to input them or sends the embedded along with the Unix timestamp they require}
{{if({input.correct}==true):{embed}|error}}
{break({input.correct}==true):The Unix Timestamp you require is `{time}`}
Raw JSON
{
  "id": 1407756,
  "created_at": "2022-05-15T09:49:45.000Z",
  "tag_name": "timestamp",
  "nsfw": false,
  "owner_id": "820928134886326272",
  "uses": 20,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "959460363949187102",
  "sharer": "890252225669132299",
  "content": "{=(COMMENT):This converts all arguments to lower case, so it doesn't matter how the user types them}\n{=(d):{lower:{1}}}\n{=(h):{lower:{2}}}\n{=(m):{lower:{3}}}\n\n{=(COMMENT):This removes the duration marking from the argument, preparing it for the maths calculations}\n{=(days):{replace(d,):{d}}}\n{=(hours):{replace(h,):{h}}}\n{=(minutes):{replace(m,):{m}}}\n\n{=(COMMENT):In case you were ever curious, this is how many seconds are in a day, hour, or minute}\n{=(days.second):86400}\n{=(hours.second):3600}\n{=(minutes.second):60}\n\n{=(COMMENT):Now we get to the maths}\n{=(d.secs):{m:{days}*{days.second}}}\n{=(h.secs):{m:{hours}*{hours.second}}}\n{=(m.secs):{m:{minutes}*{minutes.second}}}\n\n{=(total.seconds):{m:{d.secs}+{h.secs}+{m.secs}}}\n\n{=(COMMENT):This checks that they input the arguments in the correct order}\n{=(d.1):{in(d):{d}}}\n{=(h.2):{in(h):{h}}}\n{=(m.3):{in(m):{m}}}\n\n{=():}\n{=(COMMENT):Output control}\n{=(input.correct):{or({d.1}==false|{h.2}==false|{m.3}==false):false|true}}\n\n{=(time):{m:trunc({m:{unix}+{m:trunc({total.seconds})}})}}\n{=(error):You did not imput the correct format, please imput `xd yh zm`}\n\n{=(embed):c:cembed {\"fields\":[{\"name\":\"Short Time\",\"value\":\"<t:{time}:t>\\n\\\\<t:{time}:t>\",\"inline\":true},{\"name\":\"Long Time\",\"value\":\"<t:{time}:T>\\n\\\\<t:{time}:T>\",\"inline\":true},{\"name\":\"Short Date\",\"value\":\"<t:{time}:d>\\n\\\\<t:{time}:d>\",\"inline\":true},{\"name\":\"Long Date\",\"value\":\"<t:{time}:D>\\n\\\\<t:{time}:D>\",\"inline\":true},{\"name\":\"Long Date w/ Short Time\",\"value\":\"<t:{time}:f>\\n\\\\<t:{time}:f>\",\"inline\":true},{\"name\":\"Long Date w/ Day of The Week & Short Time\",\"value\":\"<t:{time}:F>\\n\\\\<t:{time}:F>\",\"inline\":true},{\"name\":\"Relative\",\"value\":\"<t:{time}:R>\\n\\\\<t:{time}:R>\",\"inline\":true}],\"title\":\"Unix Timestamp Formats \",\"description\":\"this provides quick examples of all the different Unix Timestamps available in Discord.\",\"color\":16081645,\"footer\":{\"icon_url\":\"https://images-ext-1.discordapp.net/external/MeDzvf3aNzyv2btDSkFTnX_BRwddzj0fTlhvfFFVXso/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/857254633763241984/94d230f6a296fa22084c6d7accdeea80.png\",\"text\":\"Quick Timestamp 9+10=21\"}}}\n\n{=(COMMENT):The actual output, this checks that they input the correct arguments, and then either tells them the correct way to input them or sends the embedded along with the Unix timestamp they require}\n{{if({input.correct}==true):{embed}|error}}\n{break({input.correct}==true):The Unix Timestamp you require is `{time}`}",
  "embed": "{}",
  "last_fetched": "2026-10-20T18:48:40.143Z"
}