Skip to content

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.

Examples

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.

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.

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.

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.

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.

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.

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.