Time Calculator

Time Endpoint

The Time endpoint allows you to calculate the difference between the current time and a specified point in time given as a UNIX timestamp. This endpoint is useful for applications that need to track elapsed time or calculate durations from a specific moment.

Endpoint

  • URL: https://api.erensko.xyz/v1/time

  • Method: GET

  • Description: This endpoint takes the provided UNIX time and provides a large amount of information about it.

URL Parameters

Key
Value

unix

The UNIX timestamp representing the point in time you want to compare against the current time. Measured in seconds.

timezone

The time zone you wish to use: EST, CET, or PST. Default is CET if not provided. If you would like a different option, please contact us in our support server.

Headers

Key
Value

Authorization

Your own personal API key, create one by clicking here. This is required.

Request Example

GET https://api.erensko.xyz/v1/time?unix=1735084800

Example Response:

{
    "timezone": "CET",
    "yearsAgo": 0,
    "monthsAgo": 0,
    "weeksAgo": 0,
    "daysAgo": 3,
    "hoursAgo": 77,
    "minutesAgo": 4646,
    "secondsAgo": 278770,
    "formattedTimeAgo": "3 days, 5 hours, 26 minutes, 10 seconds",
    "formattedTimeFuture": null,
    "isoTimestamp": "2025-01-27T22:59:59.999Z",
    "formattedDate": "01/27/2025",
    "humanReadableDate": "1/27/2025, 6:46:40 PM",
    "utcTimestamp": "Mon, 27 Jan 2025 17:46:40 GMT",
    "timezoneOffset": -60,
    "weekday": "Monday",
    "unixMilliseconds": 1738000000000,
    "dayOfYear": 27,
    "season": "Winter",
    "isLeapYear": false,
    "ageInYears": 0,
    "startOfDay": "2025-01-26T23:00:00.000Z",
    "endOfDay": "2025-01-27T22:59:59.999Z",
    "quarter": "Q1",
    "isDST": true,
    "weekNumber": 4,
    "isWeekend": false,
    "monthName": "January",
    "weekdayOrdinal": "27th",
    "secondsUntilMidnight": 1,
    "fullWeekRange": "2025-01-26 to 2025-02-01",
    "currentYearStartDate": "2024-12-31",
    "currentYearEndDate": "2025-12-30",
    "fullMonthRange": "2024-12-31 to 2025-01-30",
    "fullYearRange": "2024-12-31 to 2025-12-30",
    "discordFormats": {
        "discordFormat1": "<t:1738000000:f>",
        "discordFormat2": "<t:1738000000:t>",
        "discordFormat3": "<t:1738000000:d>",
        "discordFormat4": "<t:1738000000:D>",
        "discordFormat5": "<t:1738000000:t>",
        "discordFormat6": "<t:1738000000:T>",
        "discordFormat7": "<t:1738000000:R>"
    },
    "hours": "18",
    "min": "46",
    "sec": "40",
    "humanReadableTime24H": "18:46:40",
    "isFirstMondayOfMonth": false,
    "currentYear": 2025,
    "formattedTimeExtra": "January 27, 2025",
    "unixTimestamp": 1738000000,
    "isLastDayOfMonth": false
}

Usage Note

  • The timestamp parameter must be a valid UNIX timestamp (seconds since January 1, 1970).

Last updated