Skip to content
    Endpoint guide

    Elapsed since

    GET /v1/time/elapsedOpenAPI YAML

    Time between a reference timestamp and now, with direction (passed or upcoming).

    What do I need to send?

    Required / choose this first

    Provide exactly one reference timestamp: unix, unix_ms, or iso.

    Optional

    compare_* fields replace now as the comparison point; business-day fields, format, and sign are optional.

    Rule: direction is passed when the reference is earlier and left when it is still in the future.

    NameNeeded?Use it for
    unixChoose one inputReference timestamp as Unix seconds.
    unix_msChoose one inputReference timestamp as Unix milliseconds.
    isoChoose one inputReference timestamp as ISO 8601.
    source_tzConditional hintInterpret a local iso= reference as wall time in this IANA zone.
    source_ipConditional hintInterpret a local iso= reference using this IP address timezone.
    source_latPair parameterLatitude hint for local iso=. Pair with source_lon.
    source_lonPair parameterLongitude hint for local iso=. Pair with source_lat.
    source_offsetConditional hintInterpret a local iso= reference against a fixed UTC offset.
    compare_unixChoose one inputOptional comparison timestamp as Unix seconds instead of now.
    compare_unix_msChoose one inputOptional comparison timestamp as Unix milliseconds instead of now.
    compare_isoChoose one inputOptional comparison timestamp as ISO 8601 instead of now.
    compare_source_tzConditional hintInterpret a local compare_iso= timestamp as wall time in this IANA zone.
    compare_source_ipConditional hintInterpret a local compare_iso= timestamp using this IP address timezone.
    compare_source_latPair parameterLatitude hint for local compare_iso=. Pair with compare_source_lon.
    compare_source_lonPair parameterLongitude hint for local compare_iso=. Pair with compare_source_lat.
    compare_source_offsetConditional hintInterpret a local compare_iso= timestamp against a fixed UTC offset.
    tzChoose one targetCompare against the current time in this IANA timezone.
    ipChoose one targetCompare against the current time in the timezone of this IP address.
    latPair parameterTarget latitude. Pair with lon.
    lonPair parameterTarget longitude. Pair with lat.
    offsetChoose one targetCompare against the current time at this fixed UTC offset.
    formatOptionalDuration template using %days %hours %minutes %seconds for an additional `formatted` field.
    business_daysOptionalSet true to include a business_days count in the response.
    holiday_countryConditionalISO 3166-1 alpha-2 holiday calendar (e.g. FR). Requires business_days=true.
    holiday_subdivisionConditionalSubdivision code from python-holidays. Requires holiday_country and business_days=true.
    signOptionalSet true for a signed response.

    Code samples

    Copy a request in your preferred language and replace YOUR_TIMELOGIC_API_KEY with your direct API key.

    curl "https://api.timelogicapi.com/v1/time/elapsed?unix=1711300000" \
      -H "Authorization: Bearer $TIMELOGIC_API_KEY"

    Example response

    {
      "seconds": 525695,
      "minutes": 8761,
      "hours": 146,
      "days": 6,
      "human": "146 hours, 1 minute, 36 seconds",
      "direction": "passed"
    }
    
    Additional endpoint notes

    Exactly one input form is required (unix, unix_ms, or iso).

    https://api.timelogicapi.com/v1/time/elapsed?iso=2026-04-30T16:42:11Z
    https://api.timelogicapi.com/v1/time/elapsed?unix=1711300000
    

    direction is passed if the reference is in the past, left if in the future.

    Common errors

    • 400 INVALID_TIMESTAMP — no input timestamp provided.

    When to use this endpoint

    Use Elapsed since to show how much time has passed since a timestamp or how much time is left until a future timestamp. It is a compact fit for status pages, billing windows, event countdowns, and audit interfaces.

    Request model

    Provide exactly one reference timestamp as unix, unix_ms, or iso. The endpoint compares that reference against the current request time and returns normalized duration fields plus a human-readable string.

    Direction semantics

    The direction field tells you whether the reference is already passed or still left. Use that value to label UI states without reimplementing comparison logic in the browser.