Work in progress
This documentation page is currently work in progress.
Not all existing DecAPI endpoints are documented here yet - mostly Twitch and YouTube endpoints. The rest of the endpoints should have accurate documentation :)
For the currently active documentation, please visit docs.decapi.me.
Displays the time difference between two timestamps
Gives you a human-readable time difference between two specified timestamps.
Timestamps can be in any format that PHP's strtotime()
function can understand.
If you wish to specify a timezone, please include that in the timestamp itself. My recommendation is to follow the ISO 8601 standard. Example: /misc/time-difference?first=2022-10-31T13:37:06+02:00
Supports localization! Example time in German: /misc/time-difference?first=2022-10-31T13:37:06%2B02:00&lang=de
Endpoint URL
https://decapi.me/misc/time-difference?first=2022-10-31T13:37:06%2B02:00
Query parameters
first
- Required - The first timestamp to calculate from.second
- Optional - The second timestamp to calculate to. If not specified, the current time will be used.lang
- Optional - The language to localize the output to.- See the Localization section on the homepage to see what languages are currently supported.
Examples
- Time since May 17th, 1814 at 13:37:06 Central European Time: https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00
- Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian: https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no
- Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time: https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00
Examples for bots
Nightbot
Note: Nightbot will automatically convert variables, such as$(channel)
or $(touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
$(urlfetch https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00)
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
$(urlfetch https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no)
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
$(urlfetch https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00)
Fossabot
Note: Fossabot will automatically convert variables, such as$(channel)
or $(user.login)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
$(customapi https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00)
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
$(customapi https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no)
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
$(customapi https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00)
StreamElements
Note: StreamElements will automatically convert variables, such as${channel}
or ${touser}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
${customapi.https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00}
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
${customapi.https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no}
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
${customapi.https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00}
Streamlabs Chat Bot
Note: Streamlabs Chat Bot will automatically convert variables, such as$mychannel
or $touserid
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
$readapi(https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00)
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
$readapi(https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no)
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
$readapi(https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00)
Streamlabs Cloudbot
Note: Streamlabs Cloudbot will automatically convert variables, such as{channel.name}
or {touser.name}
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
{readapi.https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00}
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
{readapi.https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no}
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
{readapi.https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00}
Deepbot
Note: Deepbot will automatically convert variables, such as@stream@
or @user@
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
@customapi@[https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00]
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
@customapi@[https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no]
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
@customapi@[https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00]
PhantomBot
Note: PhantomBot will automatically convert variables, such as(channelname)
or (touser)
to the correct channel name / username, when the command is used.
You do not have to change those variables.
-
Time since May 17th, 1814 at 13:37:06 Central European Time
(customapi https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00)
-
Time since May 17th, 1814 at 13:37:06 Central European Time, localized in Norwegian
(customapi https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&lang=no)
-
Time between May 17th, 1814 at 13:37:06 Central European Time and July 4th, 1776 at 12:00:00 US Eastern Time
(customapi https://decapi.me/misc/time-difference?first=1814-05-17T13:37:06%2B02:00&second=1776-07-04T12:00:00-04:00)