timestamp

Privateunrated

Content

58 lines
{=(prefix):-}
{=(tagname):timestamp}
{=(defaulttz):+0}
{=(defaultformat):sdt}
{=(COMMENT):Optional separators can be edited below}
{=(datesep):/}
{=(timesep):.}

{=(helpcmd):Follow the tag with a date, time, and timezone with the syntax `yy{datesep}mm{datesep}dd HH{timesep}MM tz`. 
`{prefix}{tagname} 19-01-01 00:00 +8`. Defaults to current date and time if nothing is provided.
`{prefix}{tagname} format` to check all available formats in which to display the result.}
{=(formatcmd):Follow the tag with a format from below like `{prefix}{tagname} 19-01-01 00:00 -4 sdt`
`ldt` Long Date Time — Tuesday, 1 January 2019 00:00
`sdt` Short Date Time — 1 January 2019 00:00
`ld` Long Date — 1 January 2019
`sd` Short Date — 01/01/2019
`lt` Long Time — 00:00:00
`st` Short Time — 00:00
`rt` Relative Time — 3 years ago}

{=(COMMENT):DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING}

{=():}
{=(LA):{lower:{args}}}
{break({LA(1)}==help):{helpcmd}}
{break({in(format):{LA(1)}}==true):{formatcmd}}

{=(date):{any({in(-):{1}}==true|{in({datesep}):{1}}==true):{replace({datesep},-):20{1}}|{strf:%Y-%m-%d}}}

{=(hours):{list(0):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}}
{{if({list(1):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}==):=(minutes)::00|=(minutes)::{list(1):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}}}
{{if({list(2):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}==):=(seconds)::00|=(seconds)::{list(2):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}}}

{{any({in({timesep}):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}==true|{in(:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}==true):=(time):{hours}{minutes}{seconds}|=(time):{strf:%X}}}

{break({any({list(1):{replace(-,~):{date}}}>12|{list(1):{replace(-,~):{date}}}<1):true}==true):Invalid Month}
{break({any({list(2):{replace(-,~):{date}}}>31|{list(1):{replace(-,~):{date}}}<1):true}==true):Invalid Day}
{break({any({list(0):{replace(:,~):{time}}}>24|{list(0):{replace(-,~):{date}}}<0):true}==true):Invalid Hour}
{break({any({list(1):{replace(:,~):{time}}}>60|{list(1):{replace(-,~):{date}}}<0):true}==true):Invalid Minute}
{break({any({list(2):{replace(:,~):{time}}}>60|{list(2):{replace(-,~):{date}}}<0):true}==true):Invalid Second}

{=(sdt):f}{=(ldt):F}{=(sd):d}{=(ld):D}{=(st):t}{=(lt):T}{=(rt):R}
{=(format):{{lower:{args(0)}}}}
{{all({format}!=f|{format}!=F|{format}!=d|{format}!=D|{format}!=t|{format}!=T|{format}!=R):=(format):{{defaultformat}}}}

{{any({in({timesep}30):{3}}==true|{in(:30):{3}}==true):=(offset):+1800}}
{{any({in({timesep}15):{3}}==true|{in(:15):{3}}==true):=(offset):+900}}

{{if({in(+):{offset}}==false):=(offset):+0}}

{=(tz):{m:trunc({replace(+,):{replace(-,):{replace({timesep}30,):{replace({timesep}15,):{replace(:30,):{replace(:15,):{if({date}=={strf:%Y-%m-%d}):{2}|{3}}}}}}}}*3600)}}
{=(tzoffset):{if({in(m:trunc):{tz}}==true):{defaulttz}|{if({in(-):{if({date}=={strf:%Y-%m-%d}):{2}|{3}}}==true):+|-}{m:trunc({tz}{offset})}}}

{{if({LA(1)}==):=(date):{strf:%Y-%m-%d}}}
{{if({LA(1)}==):=(time):{strf:%X}}}

`<t:{m:trunc({strf({date} {time}):%s}{tzoffset})}:{format}>`
<t:{m:trunc({strf({date} {time}):%s}{tzoffset})}:{format}>
Raw JSON
{
  "id": 1045388,
  "created_at": "2021-09-05T12:38:54.000Z",
  "tag_name": "timestamp",
  "nsfw": false,
  "owner_id": "369464974550106112",
  "uses": 14,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "795142299327004673",
  "sharer": "703988787646169169",
  "content": "{=(prefix):-}\n{=(tagname):timestamp}\n{=(defaulttz):+0}\n{=(defaultformat):sdt}\n{=(COMMENT):Optional separators can be edited below}\n{=(datesep):/}\n{=(timesep):.}\n\n{=(helpcmd):Follow the tag with a date, time, and timezone with the syntax `yy{datesep}mm{datesep}dd HH{timesep}MM tz`. \n`{prefix}{tagname} 19-01-01 00:00 +8`. Defaults to current date and time if nothing is provided.\n`{prefix}{tagname} format` to check all available formats in which to display the result.}\n{=(formatcmd):Follow the tag with a format from below like `{prefix}{tagname} 19-01-01 00:00 -4 sdt`\n`ldt` Long Date Time — Tuesday, 1 January 2019 00:00\n`sdt` Short Date Time — 1 January 2019 00:00\n`ld` Long Date — 1 January 2019\n`sd` Short Date — 01/01/2019\n`lt` Long Time — 00:00:00\n`st` Short Time — 00:00\n`rt` Relative Time — 3 years ago}\n\n{=(COMMENT):DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING}\n\n{=():}\n{=(LA):{lower:{args}}}\n{break({LA(1)}==help):{helpcmd}}\n{break({in(format):{LA(1)}}==true):{formatcmd}}\n\n{=(date):{any({in(-):{1}}==true|{in({datesep}):{1}}==true):{replace({datesep},-):20{1}}|{strf:%Y-%m-%d}}}\n\n{=(hours):{list(0):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}}\n{{if({list(1):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}==):=(minutes)::00|=(minutes)::{list(1):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}}}\n{{if({list(2):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}==):=(seconds)::00|=(seconds)::{list(2):{replace(:,~):{replace({timesep},:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}}}}}\n\n{{any({in({timesep}):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}==true|{in(:):{if({date}=={strf:%Y-%m-%d}):{1}|{2}}}==true):=(time):{hours}{minutes}{seconds}|=(time):{strf:%X}}}\n\n{break({any({list(1):{replace(-,~):{date}}}>12|{list(1):{replace(-,~):{date}}}<1):true}==true):Invalid Month}\n{break({any({list(2):{replace(-,~):{date}}}>31|{list(1):{replace(-,~):{date}}}<1):true}==true):Invalid Day}\n{break({any({list(0):{replace(:,~):{time}}}>24|{list(0):{replace(-,~):{date}}}<0):true}==true):Invalid Hour}\n{break({any({list(1):{replace(:,~):{time}}}>60|{list(1):{replace(-,~):{date}}}<0):true}==true):Invalid Minute}\n{break({any({list(2):{replace(:,~):{time}}}>60|{list(2):{replace(-,~):{date}}}<0):true}==true):Invalid Second}\n\n{=(sdt):f}{=(ldt):F}{=(sd):d}{=(ld):D}{=(st):t}{=(lt):T}{=(rt):R}\n{=(format):{{lower:{args(0)}}}}\n{{all({format}!=f|{format}!=F|{format}!=d|{format}!=D|{format}!=t|{format}!=T|{format}!=R):=(format):{{defaultformat}}}}\n\n{{any({in({timesep}30):{3}}==true|{in(:30):{3}}==true):=(offset):+1800}}\n{{any({in({timesep}15):{3}}==true|{in(:15):{3}}==true):=(offset):+900}}\n\n{{if({in(+):{offset}}==false):=(offset):+0}}\n\n{=(tz):{m:trunc({replace(+,):{replace(-,):{replace({timesep}30,):{replace({timesep}15,):{replace(:30,):{replace(:15,):{if({date}=={strf:%Y-%m-%d}):{2}|{3}}}}}}}}*3600)}}\n{=(tzoffset):{if({in(m:trunc):{tz}}==true):{defaulttz}|{if({in(-):{if({date}=={strf:%Y-%m-%d}):{2}|{3}}}==true):+|-}{m:trunc({tz}{offset})}}}\n\n{{if({LA(1)}==):=(date):{strf:%Y-%m-%d}}}\n{{if({LA(1)}==):=(time):{strf:%X}}}\n\n`<t:{m:trunc({strf({date} {time}):%s}{tzoffset})}:{format}>`\n<t:{m:trunc({strf({date} {time}):%s}{tzoffset})}:{format}>",
  "embed": "{}",
  "last_fetched": "2026-10-20T17:32:41.545Z"
}