Elapsed since
GET /v1/time/elapsedOpenAPI YAMLTime between a reference timestamp and now, with direction (passed or upcoming).
What do I need to send?
Provide exactly one reference timestamp: unix, unix_ms, or iso.
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.
| Name | Needed? | Use it for |
|---|---|---|
unix | Choose one input | Reference timestamp as Unix seconds. |
unix_ms | Choose one input | Reference timestamp as Unix milliseconds. |
iso | Choose one input | Reference timestamp as ISO 8601. |
source_tz | Conditional hint | Interpret a local iso= reference as wall time in this IANA zone. |
source_ip | Conditional hint | Interpret a local iso= reference using this IP address timezone. |
source_lat | Pair parameter | Latitude hint for local iso=. Pair with source_lon. |
source_lon | Pair parameter | Longitude hint for local iso=. Pair with source_lat. |
source_offset | Conditional hint | Interpret a local iso= reference against a fixed UTC offset. |
compare_unix | Choose one input | Optional comparison timestamp as Unix seconds instead of now. |
compare_unix_ms | Choose one input | Optional comparison timestamp as Unix milliseconds instead of now. |
compare_iso | Choose one input | Optional comparison timestamp as ISO 8601 instead of now. |
compare_source_tz | Conditional hint | Interpret a local compare_iso= timestamp as wall time in this IANA zone. |
compare_source_ip | Conditional hint | Interpret a local compare_iso= timestamp using this IP address timezone. |
compare_source_lat | Pair parameter | Latitude hint for local compare_iso=. Pair with compare_source_lon. |
compare_source_lon | Pair parameter | Longitude hint for local compare_iso=. Pair with compare_source_lat. |
compare_source_offset | Conditional hint | Interpret a local compare_iso= timestamp against a fixed UTC offset. |
tz | Choose one target | Compare against the current time in this IANA timezone. |
ip | Choose one target | Compare against the current time in the timezone of this IP address. |
lat | Pair parameter | Target latitude. Pair with lon. |
lon | Pair parameter | Target longitude. Pair with lat. |
offset | Choose one target | Compare against the current time at this fixed UTC offset. |
format | Optional | Duration template using %days %hours %minutes %seconds for an additional `formatted` field. |
business_days | Optional | Set true to include a business_days count in the response. |
holiday_country | Conditional | ISO 3166-1 alpha-2 holiday calendar (e.g. FR). Requires business_days=true. |
holiday_subdivision | Conditional | Subdivision code from python-holidays. Requires holiday_country and business_days=true. |
sign | Optional | Set 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.