timelogic-api 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -16
- data/docs/TimeApi.md +60 -60
- data/lib/timelogic-api/api/time_api.rb +58 -58
- data/lib/timelogic-api/api/utility_api.rb +1 -1
- data/lib/timelogic-api/api_client.rb +8 -8
- data/lib/timelogic-api/api_error.rb +1 -1
- data/lib/timelogic-api/configuration.rb +5 -5
- data/lib/timelogic-api/models/api_error.rb +1 -1
- data/lib/timelogic-api/models/bulk_error.rb +1 -1
- data/lib/timelogic-api/models/calendar_response.rb +1 -1
- data/lib/timelogic-api/models/diff_endpoint_ref.rb +1 -1
- data/lib/timelogic-api/models/diff_response.rb +1 -1
- data/lib/timelogic-api/models/dst_response.rb +1 -1
- data/lib/timelogic-api/models/elapsed_response.rb +1 -1
- data/lib/timelogic-api/models/error_response.rb +1 -1
- data/lib/timelogic-api/models/get_current_time200_response.rb +1 -1
- data/lib/timelogic-api/models/get_timezone200_response.rb +1 -1
- data/lib/timelogic-api/models/jwk_key.rb +1 -1
- data/lib/timelogic-api/models/jwks_response.rb +1 -1
- data/lib/timelogic-api/models/time_payload.rb +1 -1
- data/lib/timelogic-api/models/time_payload_bulk_item.rb +1 -1
- data/lib/timelogic-api/models/time_payload_bulk_response.rb +1 -1
- data/lib/timelogic-api/models/timezone_match.rb +1 -1
- data/lib/timelogic-api/models/timezone_offset_response.rb +1 -1
- data/lib/timelogic-api/models/timezone_resolved_response.rb +1 -1
- data/lib/timelogic-api/version.rb +1 -1
- data/lib/timelogic-api.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a8af17ef1ae2f82e8ac1a5fd78528cab5b089214d650df40cd9e64c2bdfa243
|
|
4
|
+
data.tar.gz: 8214e8f403e5105337cf15d2c291755fb5755a49afe821c06c7b5d2311388493
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dedbd191fd1f029932322e29e9782f8f4048b453f74de61f93a2be3255d55d00a5a5ce6c13b755bf071c1ea37a9edbbf297f72acf671ac7ce8c64fb221cd1f87
|
|
7
|
+
data.tar.gz: 882f5e6e457585e3a22255d4cc5f8b9fa81eef1ee1b5e3d9e0997390046607de8b22c2693ee4f7e723d8a14a68ead226d8a585e6b850dd16391e4cf3102e9175
|
data/README.md
CHANGED
|
@@ -15,16 +15,16 @@ gem build timelogic-api.gemspec
|
|
|
15
15
|
Then either install the gem locally:
|
|
16
16
|
|
|
17
17
|
```shell
|
|
18
|
-
gem install ./timelogic-api-1.0.
|
|
18
|
+
gem install ./timelogic-api-1.0.1.gem
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
(for development, run `gem install --dev ./timelogic-api-1.0.
|
|
21
|
+
(for development, run `gem install --dev ./timelogic-api-1.0.1.gem` to install the development dependencies)
|
|
22
22
|
|
|
23
23
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
24
24
|
|
|
25
25
|
Finally add this to the Gemfile:
|
|
26
26
|
|
|
27
|
-
gem 'timelogic-api', '~> 1.0.
|
|
27
|
+
gem 'timelogic-api', '~> 1.0.1'
|
|
28
28
|
|
|
29
29
|
### Install from Git
|
|
30
30
|
|
|
@@ -50,17 +50,17 @@ require 'timelogic-api'
|
|
|
50
50
|
|
|
51
51
|
# Setup authorization
|
|
52
52
|
TimeLogic::Api.configure do |config|
|
|
53
|
-
# Configure API key authorization:
|
|
53
|
+
# Configure API key authorization: apiKeyHeader
|
|
54
54
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
55
55
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
56
56
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
57
57
|
|
|
58
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
58
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
59
59
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
60
60
|
# Configure a proc to get access tokens in lieu of the static access_token configuration
|
|
61
|
-
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
|
|
61
|
+
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
|
|
62
62
|
|
|
63
|
-
# Configure API key authorization:
|
|
63
|
+
# Configure API key authorization: apiKeyQuery
|
|
64
64
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
65
65
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
66
66
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -78,18 +78,18 @@ end
|
|
|
78
78
|
|
|
79
79
|
api_instance = TimeLogic::Api::TimeApi.new
|
|
80
80
|
opts = {
|
|
81
|
-
unix: 1711300000, # Integer |
|
|
82
|
-
unix_ms: 1711300000000, # Integer |
|
|
81
|
+
unix: 1711300000, # Integer |
|
|
82
|
+
unix_ms: 1711300000000, # Integer |
|
|
83
83
|
iso: '2024-03-24T15:00:00', # String | ISO-8601 timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `source_tz=Area/City`, `source_ip=...`, `source_lat=...&source_lon=...`, or `source_offset=±HH:MM`.
|
|
84
84
|
source_tz: 'America/New_York', # String | Used only with `iso=...` when the ISO value has no explicit offset.
|
|
85
85
|
source_ip: '8.8.8.8', # String | Used only with `iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
86
86
|
source_lat: 40.7128, # Float | Used only with `iso=...` when the ISO value has no explicit offset. Provide together with `source_lon` to resolve that local wall-clock time through the timezone mapped from these coordinates.
|
|
87
87
|
source_lon: -74.006, # Float | Used only with `iso=...` when the ISO value has no explicit offset. Provide together with `source_lat`.
|
|
88
88
|
source_offset: '-05:00', # String | Used only with `iso=...` when the ISO value has no explicit offset. Interprets that local wall-clock time at this fixed UTC offset.
|
|
89
|
-
seconds: 30, # Integer |
|
|
90
|
-
minutes: 15, # Integer |
|
|
91
|
-
hours: 2, # Integer |
|
|
92
|
-
days: 7, # Integer |
|
|
89
|
+
seconds: 30, # Integer |
|
|
90
|
+
minutes: 15, # Integer |
|
|
91
|
+
hours: 2, # Integer |
|
|
92
|
+
days: 7, # Integer |
|
|
93
93
|
tz: 'America/New_York', # String | IANA timezone name. On bulk-capable routes, a comma-separated list enables bulk mode.
|
|
94
94
|
ip: '8.8.8.8', # String | IP address. On bulk-capable routes, a comma-separated list enables bulk mode.
|
|
95
95
|
lat: 40.7128, # Float | Latitude. Must be provided together with `lon`.
|
|
@@ -155,18 +155,18 @@ Class | Method | HTTP request | Description
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
Authentication schemes defined for the API:
|
|
158
|
-
###
|
|
158
|
+
### bearerAuth
|
|
159
159
|
|
|
160
160
|
- **Type**: Bearer authentication (TimeLogic API key)
|
|
161
161
|
|
|
162
|
-
###
|
|
162
|
+
### apiKeyHeader
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
- **Type**: API key
|
|
166
166
|
- **API key parameter name**: X-API-Key
|
|
167
167
|
- **Location**: HTTP header
|
|
168
168
|
|
|
169
|
-
###
|
|
169
|
+
### apiKeyQuery
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
- **Type**: API key
|
data/docs/TimeApi.md
CHANGED
|
@@ -21,7 +21,7 @@ All URIs are relative to *https://api.timelogicapi.com*
|
|
|
21
21
|
|
|
22
22
|
Add modifiers to a timestamp
|
|
23
23
|
|
|
24
|
-
Adds `seconds`, `minutes`, `hours`, and `days` to an optional base timestamp. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` - if no input timestamp is provided, the base timestamp defaults to the request time Modifiers: - `seconds=30` - `minutes=15` - `hours=2` - `days=7` Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` - `utc=true` Incompatible combinations: - at most one input timestamp form - at most one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - bulk is not supported on this route Examples: - `/v1/time/add?iso=2026-04-16T09:00:00&source_tz=America/New_York&days=1&tz=Europe/London` - `/v1/time/add?minutes=30&utc=true`
|
|
24
|
+
Adds `seconds`, `minutes`, `hours`, and `days` to an optional base timestamp. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` - if no input timestamp is provided, the base timestamp defaults to the request time Modifiers: - `seconds=30` - `minutes=15` - `hours=2` - `days=7` Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` - `utc=true` Incompatible combinations: - at most one input timestamp form - at most one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - bulk is not supported on this route Examples: - `/v1/time/add?iso=2026-04-16T09:00:00&source_tz=America/New_York&days=1&tz=Europe/London` - `/v1/time/add?minutes=30&utc=true`
|
|
25
25
|
|
|
26
26
|
### Examples
|
|
27
27
|
|
|
@@ -30,15 +30,15 @@ require 'time'
|
|
|
30
30
|
require 'timelogic-api'
|
|
31
31
|
# setup authorization
|
|
32
32
|
TimeLogic::Api.configure do |config|
|
|
33
|
-
# Configure API key authorization:
|
|
33
|
+
# Configure API key authorization: apiKeyHeader
|
|
34
34
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
35
35
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
36
36
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
37
37
|
|
|
38
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
38
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
39
39
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
40
40
|
|
|
41
|
-
# Configure API key authorization:
|
|
41
|
+
# Configure API key authorization: apiKeyQuery
|
|
42
42
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
43
43
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
44
44
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -56,18 +56,18 @@ end
|
|
|
56
56
|
|
|
57
57
|
api_instance = TimeLogic::Api::TimeApi.new
|
|
58
58
|
opts = {
|
|
59
|
-
unix: 1711300000, # Integer |
|
|
60
|
-
unix_ms: 1711300000000, # Integer |
|
|
59
|
+
unix: 1711300000, # Integer |
|
|
60
|
+
unix_ms: 1711300000000, # Integer |
|
|
61
61
|
iso: '2024-03-24T15:00:00', # String | ISO-8601 timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `source_tz=Area/City`, `source_ip=...`, `source_lat=...&source_lon=...`, or `source_offset=±HH:MM`.
|
|
62
62
|
source_tz: 'America/New_York', # String | Used only with `iso=...` when the ISO value has no explicit offset.
|
|
63
63
|
source_ip: '8.8.8.8', # String | Used only with `iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
64
64
|
source_lat: 40.7128, # Float | Used only with `iso=...` when the ISO value has no explicit offset. Provide together with `source_lon` to resolve that local wall-clock time through the timezone mapped from these coordinates.
|
|
65
65
|
source_lon: -74.006, # Float | Used only with `iso=...` when the ISO value has no explicit offset. Provide together with `source_lat`.
|
|
66
66
|
source_offset: '-05:00', # String | Used only with `iso=...` when the ISO value has no explicit offset. Interprets that local wall-clock time at this fixed UTC offset.
|
|
67
|
-
seconds: 30, # Integer |
|
|
68
|
-
minutes: 15, # Integer |
|
|
69
|
-
hours: 2, # Integer |
|
|
70
|
-
days: 7, # Integer |
|
|
67
|
+
seconds: 30, # Integer |
|
|
68
|
+
minutes: 15, # Integer |
|
|
69
|
+
hours: 2, # Integer |
|
|
70
|
+
days: 7, # Integer |
|
|
71
71
|
tz: 'America/New_York', # String | IANA timezone name. On bulk-capable routes, a comma-separated list enables bulk mode.
|
|
72
72
|
ip: '8.8.8.8', # String | IP address. On bulk-capable routes, a comma-separated list enables bulk mode.
|
|
73
73
|
lat: 40.7128, # Float | Latitude. Must be provided together with `lon`.
|
|
@@ -138,7 +138,7 @@ end
|
|
|
138
138
|
|
|
139
139
|
### Authorization
|
|
140
140
|
|
|
141
|
-
[
|
|
141
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
142
142
|
|
|
143
143
|
### HTTP request headers
|
|
144
144
|
|
|
@@ -152,7 +152,7 @@ end
|
|
|
152
152
|
|
|
153
153
|
Convert a timestamp into a target timezone or offset
|
|
154
154
|
|
|
155
|
-
Converts one required input timestamp into a single target or a bulk array. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` - `utc=true` Incompatible combinations: - exactly one input timestamp form - exactly one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - bulk is allowed only through one comma-separated `tz`, `ip`, or `offset` selector Examples: - Single target: `/v1/time/convert?iso=2026-04-16T09:00:00&source_tz=America/New_York&tz=Europe/London` - Bulk target set: `/v1/time/convert?unix=1711300000&offset=-04:00,+00:00,+09:00`
|
|
155
|
+
Converts one required input timestamp into a single target or a bulk array. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` - `utc=true` Incompatible combinations: - exactly one input timestamp form - exactly one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - bulk is allowed only through one comma-separated `tz`, `ip`, or `offset` selector Examples: - Single target: `/v1/time/convert?iso=2026-04-16T09:00:00&source_tz=America/New_York&tz=Europe/London` - Bulk target set: `/v1/time/convert?unix=1711300000&offset=-04:00,+00:00,+09:00`
|
|
156
156
|
|
|
157
157
|
### Examples
|
|
158
158
|
|
|
@@ -161,15 +161,15 @@ require 'time'
|
|
|
161
161
|
require 'timelogic-api'
|
|
162
162
|
# setup authorization
|
|
163
163
|
TimeLogic::Api.configure do |config|
|
|
164
|
-
# Configure API key authorization:
|
|
164
|
+
# Configure API key authorization: apiKeyHeader
|
|
165
165
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
166
166
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
167
167
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
168
168
|
|
|
169
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
169
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
170
170
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
171
171
|
|
|
172
|
-
# Configure API key authorization:
|
|
172
|
+
# Configure API key authorization: apiKeyQuery
|
|
173
173
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
174
174
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
175
175
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -187,8 +187,8 @@ end
|
|
|
187
187
|
|
|
188
188
|
api_instance = TimeLogic::Api::TimeApi.new
|
|
189
189
|
opts = {
|
|
190
|
-
unix: 1711300000, # Integer |
|
|
191
|
-
unix_ms: 1711300000000, # Integer |
|
|
190
|
+
unix: 1711300000, # Integer |
|
|
191
|
+
unix_ms: 1711300000000, # Integer |
|
|
192
192
|
iso: '2024-03-24T15:00:00', # String | ISO-8601 timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `source_tz=Area/City`, `source_ip=...`, `source_lat=...&source_lon=...`, or `source_offset=±HH:MM`.
|
|
193
193
|
source_tz: 'America/New_York', # String | Used only with `iso=...` when the ISO value has no explicit offset.
|
|
194
194
|
source_ip: '8.8.8.8', # String | Used only with `iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
@@ -261,7 +261,7 @@ end
|
|
|
261
261
|
|
|
262
262
|
### Authorization
|
|
263
263
|
|
|
264
|
-
[
|
|
264
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
265
265
|
|
|
266
266
|
### HTTP request headers
|
|
267
267
|
|
|
@@ -275,7 +275,7 @@ end
|
|
|
275
275
|
|
|
276
276
|
Difference between two instants
|
|
277
277
|
|
|
278
|
-
Computes the duration between `from` and `to`. Required query fields: `from` and `to` only. Do not send every optional companion field. For each side, choose one supported specifier form. A `from_*` or `to_*` companion is allowed only when that side uses `iso=...` with no explicit offset; use at most one companion selector, except that coordinate input requires its paired latitude and longitude. `from` and `to` are embedded specifier strings. Accepted specifier forms: - `from=now` - `from=unix=1711300000` - `from=unix_ms=1711300000000` - `from=iso=2026-04-16T09:00:00` - `from=tz=America/New_York` - `from=ip=8.8.8.8` - `from=offset=-05:00` - the same forms are accepted for `to` Timezone hint pairings: - `from_tz` only with `from=iso=...` that has no explicit offset - `from_ip`, `from_lat`/`from_lon`, and `from_offset` only with `from=iso=...` that has no explicit offset - `to_tz` only with `to=iso=...` that has no explicit offset - `to_ip`, `to_lat`/`to_lon`, and `to_offset` only with `to=iso=...` that has no explicit offset Selector semantics: - `tz=...`, `ip=...`, and `offset=...` inside `from` or `to` mean the current request-time instant resolved through that selector - those selector forms do not represent an arbitrary local wall-clock time - returned duration magnitudes are absolute; use `direction` to see whether `to` is after, before, or the same instant as `from` Business-day rules: - `holiday_country` and `holiday_subdivision` require `business_days=true` - `holiday_subdivision` also requires `holiday_country` Examples: - Selector-current instant: `/v1/time/diff?from=unix=1711300000&to=tz=America/New_York` - Wall-clock pairing: `/v1/time/diff?from=iso=2026-04-16T09:00:00&from_tz=America/New_York&to=iso=2026-04-16T09:00:00&to_tz=Europe/London` - Wall-clock via selector: `/v1/time/diff?from=iso=2026-01-01T12:00:00&from_ip=8.8.8.8&to=iso=2026-01-01T12:00:00&to_offset=-05:00`
|
|
278
|
+
Computes the duration between `from` and `to`. Required query fields: `from` and `to` only. Do not send every optional companion field. For each side, choose one supported specifier form. A `from_*` or `to_*` companion is allowed only when that side uses `iso=...` with no explicit offset; use at most one companion selector, except that coordinate input requires its paired latitude and longitude. `from` and `to` are embedded specifier strings. Accepted specifier forms: - `from=now` - `from=unix=1711300000` - `from=unix_ms=1711300000000` - `from=iso=2026-04-16T09:00:00` - `from=tz=America/New_York` - `from=ip=8.8.8.8` - `from=offset=-05:00` - the same forms are accepted for `to` Timezone hint pairings: - `from_tz` only with `from=iso=...` that has no explicit offset - `from_ip`, `from_lat`/`from_lon`, and `from_offset` only with `from=iso=...` that has no explicit offset - `to_tz` only with `to=iso=...` that has no explicit offset - `to_ip`, `to_lat`/`to_lon`, and `to_offset` only with `to=iso=...` that has no explicit offset Selector semantics: - `tz=...`, `ip=...`, and `offset=...` inside `from` or `to` mean the current request-time instant resolved through that selector - those selector forms do not represent an arbitrary local wall-clock time - returned duration magnitudes are absolute; use `direction` to see whether `to` is after, before, or the same instant as `from` Business-day rules: - `holiday_country` and `holiday_subdivision` require `business_days=true` - `holiday_subdivision` also requires `holiday_country` Examples: - Selector-current instant: `/v1/time/diff?from=unix=1711300000&to=tz=America/New_York` - Wall-clock pairing: `/v1/time/diff?from=iso=2026-04-16T09:00:00&from_tz=America/New_York&to=iso=2026-04-16T09:00:00&to_tz=Europe/London` - Wall-clock via selector: `/v1/time/diff?from=iso=2026-01-01T12:00:00&from_ip=8.8.8.8&to=iso=2026-01-01T12:00:00&to_offset=-05:00`
|
|
279
279
|
|
|
280
280
|
### Examples
|
|
281
281
|
|
|
@@ -284,15 +284,15 @@ require 'time'
|
|
|
284
284
|
require 'timelogic-api'
|
|
285
285
|
# setup authorization
|
|
286
286
|
TimeLogic::Api.configure do |config|
|
|
287
|
-
# Configure API key authorization:
|
|
287
|
+
# Configure API key authorization: apiKeyHeader
|
|
288
288
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
289
289
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
290
290
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
291
291
|
|
|
292
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
292
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
293
293
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
294
294
|
|
|
295
|
-
# Configure API key authorization:
|
|
295
|
+
# Configure API key authorization: apiKeyQuery
|
|
296
296
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
297
297
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
298
298
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -384,7 +384,7 @@ end
|
|
|
384
384
|
|
|
385
385
|
### Authorization
|
|
386
386
|
|
|
387
|
-
[
|
|
387
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
388
388
|
|
|
389
389
|
### HTTP request headers
|
|
390
390
|
|
|
@@ -398,7 +398,7 @@ end
|
|
|
398
398
|
|
|
399
399
|
Calendar projection for a target instant
|
|
400
400
|
|
|
401
|
-
Returns calendar fields for an optional timestamp and target. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` - if no input timestamp is provided, the request time is used Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` Additional flags: - `week=true` adds `week_number` Incompatible combinations: - at most one input timestamp form - at most one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - bulk is not supported on this route Examples: - `/v1/time/calendar?iso=2026-04-16T09:00:00&source_tz=America/New_York&tz=Europe/London&week=true` - `/v1/time/calendar?unix=1711300000&auto_tz=true`
|
|
401
|
+
Returns calendar fields for an optional timestamp and target. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` - if no input timestamp is provided, the request time is used Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` Additional flags: - `week=true` adds `week_number` Incompatible combinations: - at most one input timestamp form - at most one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - bulk is not supported on this route Examples: - `/v1/time/calendar?iso=2026-04-16T09:00:00&source_tz=America/New_York&tz=Europe/London&week=true` - `/v1/time/calendar?unix=1711300000&auto_tz=true`
|
|
402
402
|
|
|
403
403
|
### Examples
|
|
404
404
|
|
|
@@ -407,15 +407,15 @@ require 'time'
|
|
|
407
407
|
require 'timelogic-api'
|
|
408
408
|
# setup authorization
|
|
409
409
|
TimeLogic::Api.configure do |config|
|
|
410
|
-
# Configure API key authorization:
|
|
410
|
+
# Configure API key authorization: apiKeyHeader
|
|
411
411
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
412
412
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
413
413
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
414
414
|
|
|
415
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
415
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
416
416
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
417
417
|
|
|
418
|
-
# Configure API key authorization:
|
|
418
|
+
# Configure API key authorization: apiKeyQuery
|
|
419
419
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
420
420
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
421
421
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -433,8 +433,8 @@ end
|
|
|
433
433
|
|
|
434
434
|
api_instance = TimeLogic::Api::TimeApi.new
|
|
435
435
|
opts = {
|
|
436
|
-
unix: 1711300000, # Integer |
|
|
437
|
-
unix_ms: 1711300000000, # Integer |
|
|
436
|
+
unix: 1711300000, # Integer |
|
|
437
|
+
unix_ms: 1711300000000, # Integer |
|
|
438
438
|
iso: '2024-03-24T15:00:00', # String | ISO-8601 timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `source_tz=Area/City`, `source_ip=...`, `source_lat=...&source_lon=...`, or `source_offset=±HH:MM`.
|
|
439
439
|
source_tz: 'America/New_York', # String | Used only with `iso=...` when the ISO value has no explicit offset.
|
|
440
440
|
source_ip: '8.8.8.8', # String | Used only with `iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
@@ -448,7 +448,7 @@ opts = {
|
|
|
448
448
|
offset: '-04:00', # String | Fixed UTC offset in `+HH:MM` or `-HH:MM` format. On bulk-capable routes, a comma-separated list enables bulk mode.
|
|
449
449
|
auto_tz: true, # Boolean | Set to `true` to resolve using the caller IP from Cloudflare headers.
|
|
450
450
|
format: '%Y-%m-%d %H:%M:%S', # String | Custom date/time format template using supported `strftime`-style directives such as `%Y-%m-%d %H:%M:%S`. Reference: [strftime](https://strftime.net/).
|
|
451
|
-
week: true, # Boolean |
|
|
451
|
+
week: true, # Boolean |
|
|
452
452
|
sign: true # Boolean | Set to exactly `true` to ask the gateway to sign the final JSON response. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`.
|
|
453
453
|
}
|
|
454
454
|
|
|
@@ -507,7 +507,7 @@ end
|
|
|
507
507
|
|
|
508
508
|
### Authorization
|
|
509
509
|
|
|
510
|
-
[
|
|
510
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
511
511
|
|
|
512
512
|
### HTTP request headers
|
|
513
513
|
|
|
@@ -521,7 +521,7 @@ end
|
|
|
521
521
|
|
|
522
522
|
Render a live HTML clock
|
|
523
523
|
|
|
524
|
-
Returns an embeddable HTML clock fragment. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` Incompatible combinations: - `style` is required and must be one of the 30 names in the `style` enum - at most one input timestamp form - at most one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - this route is single-target only; comma-separated `tz`, `ip`, and `offset` values are rejected - `auto_tz` is not supported on this route - `sign` is not supported on this route Examples: - Digital: `/v1/time/clock?style=digital-dashboard&iso=2026-04-16T09:00:00&source_tz=America/New_York&tz=Europe/London` - Analog: `/v1/time/clock?style=analog-station&offset=-04:00`
|
|
524
|
+
Returns an embeddable HTML clock fragment. Input timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` Target selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` Incompatible combinations: - `style` is required and must be one of the 30 names in the `style` enum - at most one input timestamp form - at most one target selector family - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - this route is single-target only; comma-separated `tz`, `ip`, and `offset` values are rejected - `auto_tz` is not supported on this route - `sign` is not supported on this route Examples: - Digital: `/v1/time/clock?style=digital-dashboard&iso=2026-04-16T09:00:00&source_tz=America/New_York&tz=Europe/London` - Analog: `/v1/time/clock?style=analog-station&offset=-04:00`
|
|
525
525
|
|
|
526
526
|
### Examples
|
|
527
527
|
|
|
@@ -530,15 +530,15 @@ require 'time'
|
|
|
530
530
|
require 'timelogic-api'
|
|
531
531
|
# setup authorization
|
|
532
532
|
TimeLogic::Api.configure do |config|
|
|
533
|
-
# Configure API key authorization:
|
|
533
|
+
# Configure API key authorization: apiKeyHeader
|
|
534
534
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
535
535
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
536
536
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
537
537
|
|
|
538
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
538
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
539
539
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
540
540
|
|
|
541
|
-
# Configure API key authorization:
|
|
541
|
+
# Configure API key authorization: apiKeyQuery
|
|
542
542
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
543
543
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
544
544
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -557,8 +557,8 @@ end
|
|
|
557
557
|
api_instance = TimeLogic::Api::TimeApi.new
|
|
558
558
|
style = 'analog-station' # String | Clock style name. Valid values are enumerated here; there is no separate style discovery endpoint.
|
|
559
559
|
opts = {
|
|
560
|
-
unix: 1711300000, # Integer |
|
|
561
|
-
unix_ms: 1711300000000, # Integer |
|
|
560
|
+
unix: 1711300000, # Integer |
|
|
561
|
+
unix_ms: 1711300000000, # Integer |
|
|
562
562
|
iso: '2024-03-24T15:00:00', # String | ISO-8601 timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `source_tz=Area/City`, `source_ip=...`, `source_lat=...&source_lon=...`, or `source_offset=±HH:MM`.
|
|
563
563
|
source_tz: 'America/New_York', # String | Used only with `iso=...` when the ISO value has no explicit offset.
|
|
564
564
|
source_ip: '8.8.8.8', # String | Used only with `iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
@@ -626,7 +626,7 @@ end
|
|
|
626
626
|
|
|
627
627
|
### Authorization
|
|
628
628
|
|
|
629
|
-
[
|
|
629
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
630
630
|
|
|
631
631
|
### HTTP request headers
|
|
632
632
|
|
|
@@ -649,15 +649,15 @@ require 'time'
|
|
|
649
649
|
require 'timelogic-api'
|
|
650
650
|
# setup authorization
|
|
651
651
|
TimeLogic::Api.configure do |config|
|
|
652
|
-
# Configure API key authorization:
|
|
652
|
+
# Configure API key authorization: apiKeyHeader
|
|
653
653
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
654
654
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
655
655
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
656
656
|
|
|
657
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
657
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
658
658
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
659
659
|
|
|
660
|
-
# Configure API key authorization:
|
|
660
|
+
# Configure API key authorization: apiKeyQuery
|
|
661
661
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
662
662
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
663
663
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -731,7 +731,7 @@ end
|
|
|
731
731
|
|
|
732
732
|
### Authorization
|
|
733
733
|
|
|
734
|
-
[
|
|
734
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
735
735
|
|
|
736
736
|
### HTTP request headers
|
|
737
737
|
|
|
@@ -754,15 +754,15 @@ require 'time'
|
|
|
754
754
|
require 'timelogic-api'
|
|
755
755
|
# setup authorization
|
|
756
756
|
TimeLogic::Api.configure do |config|
|
|
757
|
-
# Configure API key authorization:
|
|
757
|
+
# Configure API key authorization: apiKeyHeader
|
|
758
758
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
759
759
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
760
760
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
761
761
|
|
|
762
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
762
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
763
763
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
764
764
|
|
|
765
|
-
# Configure API key authorization:
|
|
765
|
+
# Configure API key authorization: apiKeyQuery
|
|
766
766
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
767
767
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
768
768
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -787,7 +787,7 @@ opts = {
|
|
|
787
787
|
offset: '-04:00', # String | Fixed UTC offset in `+HH:MM` or `-HH:MM` format. On bulk-capable routes, a comma-separated list enables bulk mode.
|
|
788
788
|
auto_tz: true, # Boolean | Set to `true` to resolve using the caller IP from Cloudflare headers.
|
|
789
789
|
format: '%Y-%m-%d %H:%M:%S', # String | Custom date/time format template using supported `strftime`-style directives such as `%Y-%m-%d %H:%M:%S`. Reference: [strftime](https://strftime.net/).
|
|
790
|
-
_next: true, # Boolean |
|
|
790
|
+
_next: true, # Boolean |
|
|
791
791
|
sign: true # Boolean | Set to exactly `true` to ask the gateway to sign the final JSON response. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`.
|
|
792
792
|
}
|
|
793
793
|
|
|
@@ -838,7 +838,7 @@ end
|
|
|
838
838
|
|
|
839
839
|
### Authorization
|
|
840
840
|
|
|
841
|
-
[
|
|
841
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
842
842
|
|
|
843
843
|
### HTTP request headers
|
|
844
844
|
|
|
@@ -852,7 +852,7 @@ end
|
|
|
852
852
|
|
|
853
853
|
Time elapsed since or remaining until a reference instant
|
|
854
854
|
|
|
855
|
-
Computes elapsed or remaining duration relative to one required reference timestamp. Reference timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` Compare timestamp forms: - `compare_unix=1711213600` - `compare_unix_ms=1711213600000` - `compare_iso=2026-04-16T09:00:00Z` - `compare_iso=2026-04-16T09:00:00&compare_source_tz=Europe/London` - `compare_iso=2026-04-16T09:00:00&compare_source_ip=8.8.8.8` - `compare_iso=2026-04-16T09:00:00&compare_source_lat=40.7128&compare_source_lon=-74.0060` - `compare_iso=2026-04-16T09:00:00&compare_source_offset=-05:00` Compare selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` Incompatible combinations: - exactly one reference timestamp form - use either one compare timestamp form or one compare selector family, not both - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - use at most one of `compare_source_tz`, `compare_source_ip`, `compare_source_lat`/`compare_source_lon`, or `compare_source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - compare local-ISO companion selectors are valid only with `compare_iso=...` that has no explicit offset - if no compare input is provided, the comparison defaults to the request time Business-day rules: - `holiday_country` and `holiday_subdivision` require `business_days=true` - `holiday_subdivision` also requires `holiday_country` Examples: - Timestamp-to-timestamp: `/v1/time/elapsed?iso=2026-04-16T09:00:00&source_tz=America/New_York&compare_iso=2026-04-16T09:00:00&compare_source_tz=Europe/London` - Timestamp-to-selector: `/v1/time/elapsed?unix=1711300000&tz=America/New_York&business_days=true`
|
|
855
|
+
Computes elapsed or remaining duration relative to one required reference timestamp. Reference timestamp forms: - `unix=1711300000` - `unix_ms=1711300000000` - `iso=2026-04-16T09:00:00Z` - `iso=2026-04-16T09:00:00&source_tz=America/New_York` - `iso=2026-04-16T09:00:00&source_ip=8.8.8.8` - `iso=2026-04-16T09:00:00&source_lat=40.7128&source_lon=-74.0060` - `iso=2026-04-16T09:00:00&source_offset=-05:00` Compare timestamp forms: - `compare_unix=1711213600` - `compare_unix_ms=1711213600000` - `compare_iso=2026-04-16T09:00:00Z` - `compare_iso=2026-04-16T09:00:00&compare_source_tz=Europe/London` - `compare_iso=2026-04-16T09:00:00&compare_source_ip=8.8.8.8` - `compare_iso=2026-04-16T09:00:00&compare_source_lat=40.7128&compare_source_lon=-74.0060` - `compare_iso=2026-04-16T09:00:00&compare_source_offset=-05:00` Compare selector forms: - `tz=America/New_York` - `ip=8.8.8.8` - `lat=40.7128&lon=-74.0060` - `offset=-04:00` - `auto_tz=true` Incompatible combinations: - exactly one reference timestamp form - use either one compare timestamp form or one compare selector family, not both - use at most one of `source_tz`, `source_ip`, `source_lat`/`source_lon`, or `source_offset` - use at most one of `compare_source_tz`, `compare_source_ip`, `compare_source_lat`/`compare_source_lon`, or `compare_source_offset` - local-ISO companion selectors are valid only with `iso=...` that has no explicit offset - compare local-ISO companion selectors are valid only with `compare_iso=...` that has no explicit offset - if no compare input is provided, the comparison defaults to the request time Business-day rules: - `holiday_country` and `holiday_subdivision` require `business_days=true` - `holiday_subdivision` also requires `holiday_country` Examples: - Timestamp-to-timestamp: `/v1/time/elapsed?iso=2026-04-16T09:00:00&source_tz=America/New_York&compare_iso=2026-04-16T09:00:00&compare_source_tz=Europe/London` - Timestamp-to-selector: `/v1/time/elapsed?unix=1711300000&tz=America/New_York&business_days=true`
|
|
856
856
|
|
|
857
857
|
### Examples
|
|
858
858
|
|
|
@@ -861,15 +861,15 @@ require 'time'
|
|
|
861
861
|
require 'timelogic-api'
|
|
862
862
|
# setup authorization
|
|
863
863
|
TimeLogic::Api.configure do |config|
|
|
864
|
-
# Configure API key authorization:
|
|
864
|
+
# Configure API key authorization: apiKeyHeader
|
|
865
865
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
866
866
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
867
867
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
868
868
|
|
|
869
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
869
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
870
870
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
871
871
|
|
|
872
|
-
# Configure API key authorization:
|
|
872
|
+
# Configure API key authorization: apiKeyQuery
|
|
873
873
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
874
874
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
875
875
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -887,16 +887,16 @@ end
|
|
|
887
887
|
|
|
888
888
|
api_instance = TimeLogic::Api::TimeApi.new
|
|
889
889
|
opts = {
|
|
890
|
-
unix: 1711300000, # Integer |
|
|
891
|
-
unix_ms: 1711300000000, # Integer |
|
|
890
|
+
unix: 1711300000, # Integer |
|
|
891
|
+
unix_ms: 1711300000000, # Integer |
|
|
892
892
|
iso: '2024-03-24T15:00:00', # String | ISO-8601 timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `source_tz=Area/City`, `source_ip=...`, `source_lat=...&source_lon=...`, or `source_offset=±HH:MM`.
|
|
893
893
|
source_tz: 'America/New_York', # String | Used only with `iso=...` when the ISO value has no explicit offset.
|
|
894
894
|
source_ip: '8.8.8.8', # String | Used only with `iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
895
895
|
source_lat: 40.7128, # Float | Used only with `iso=...` when the ISO value has no explicit offset. Provide together with `source_lon` to resolve that local wall-clock time through the timezone mapped from these coordinates.
|
|
896
896
|
source_lon: -74.006, # Float | Used only with `iso=...` when the ISO value has no explicit offset. Provide together with `source_lat`.
|
|
897
897
|
source_offset: '-05:00', # String | Used only with `iso=...` when the ISO value has no explicit offset. Interprets that local wall-clock time at this fixed UTC offset.
|
|
898
|
-
compare_unix: 1711213600, # Integer |
|
|
899
|
-
compare_unix_ms: 1711213600000, # Integer |
|
|
898
|
+
compare_unix: 1711213600, # Integer |
|
|
899
|
+
compare_unix_ms: 1711213600000, # Integer |
|
|
900
900
|
compare_iso: '2024-03-23T15:00:00', # String | ISO-8601 comparison timestamp. To supply a local wall-clock time without an explicit offset, pair it with one of `compare_source_tz=Area/City`, `compare_source_ip=...`, `compare_source_lat=...&compare_source_lon=...`, or `compare_source_offset=±HH:MM`.
|
|
901
901
|
compare_source_tz: 'America/New_York', # String | Used only with `compare_iso=...` when the ISO value has no explicit offset.
|
|
902
902
|
compare_source_ip: '8.8.8.8', # String | Used only with `compare_iso=...` when the ISO value has no explicit offset. Resolves that local wall-clock time through the timezone mapped from this IP address.
|
|
@@ -981,7 +981,7 @@ end
|
|
|
981
981
|
|
|
982
982
|
### Authorization
|
|
983
983
|
|
|
984
|
-
[
|
|
984
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
985
985
|
|
|
986
986
|
### HTTP request headers
|
|
987
987
|
|
|
@@ -1004,15 +1004,15 @@ require 'time'
|
|
|
1004
1004
|
require 'timelogic-api'
|
|
1005
1005
|
# setup authorization
|
|
1006
1006
|
TimeLogic::Api.configure do |config|
|
|
1007
|
-
# Configure API key authorization:
|
|
1007
|
+
# Configure API key authorization: apiKeyHeader
|
|
1008
1008
|
config.api_key['X-API-Key'] = 'YOUR API KEY'
|
|
1009
1009
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
1010
1010
|
# config.api_key_prefix['X-API-Key'] = 'Bearer'
|
|
1011
1011
|
|
|
1012
|
-
# Configure Bearer authorization (TimeLogic API key):
|
|
1012
|
+
# Configure Bearer authorization (TimeLogic API key): bearerAuth
|
|
1013
1013
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
1014
1014
|
|
|
1015
|
-
# Configure API key authorization:
|
|
1015
|
+
# Configure API key authorization: apiKeyQuery
|
|
1016
1016
|
config.api_key['api_key'] = 'YOUR API KEY'
|
|
1017
1017
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
1018
1018
|
# config.api_key_prefix['api_key'] = 'Bearer'
|
|
@@ -1084,7 +1084,7 @@ end
|
|
|
1084
1084
|
|
|
1085
1085
|
### Authorization
|
|
1086
1086
|
|
|
1087
|
-
[
|
|
1087
|
+
[apiKeyHeader](../README.md#apiKeyHeader), [bearerAuth](../README.md#bearerAuth), [apiKeyQuery](../README.md#apiKeyQuery), [rapidApiKey](../README.md#rapidApiKey), [rapidApiHost](../README.md#rapidApiHost)
|
|
1088
1088
|
|
|
1089
1089
|
### HTTP request headers
|
|
1090
1090
|
|