timelogic-api / php-sdk
TimeLogic API | A World Time API
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-23 16:49:29 UTC
README
Official client libraries for TimeLogic API, a world-time API for current time, time zones, calendars, daylight-saving rules, elapsed time, and signed JSON responses.
The SDKs are generated from the versioned contract in openapi/openapi.yaml. The repository keeps the source contract, language clients, tests, and independent release automation together so every published client represents the same API.
Supported SDKs
| Language | Package | Install |
|---|---|---|
| TypeScript / JavaScript | @timelogic/direct-api |
npm install @timelogic/direct-api |
| Python | timelogic-api |
python -m pip install timelogic-api |
| Rust | timelogic-api |
cargo add timelogic-api |
| Go | packages/go |
go get github.com/TimeLogic-API-LLC/timelogic-api-sdks/packages/go |
| Java | com.timelogicapi:timelogic-api |
Maven Central |
| Kotlin | com.timelogicapi:timelogic-api-kotlin |
Maven Central |
| .NET | TimeLogic.Api |
dotnet add package TimeLogic.Api |
| PHP | timelogic-api/php-sdk |
composer require timelogic-api/php-sdk |
| Ruby | timelogic-api |
gem install timelogic-api |
| Swift | TimeLogicAPI |
Swift Package Manager |
API capabilities
- Current time by timezone, IP address, or UTC offset
- Time conversion, differences, elapsed time, calendars, and daylight-saving status
- Timezone resolution and a live clock endpoint
- Optional signed JSON responses and public signing-key discovery
- Direct API and RapidAPI transports
All documented operations are GET requests. The contract rejects conflicting credential selectors and permits only one selector family per request.
Authentication
Keep API keys in environment variables or your platform secret store. Never commit credentials to source control.
$env:TIMELOGIC_API_KEY = "your-api-key"
Direct API clients use the key supplied through their language-specific configuration. RapidAPI clients use the rapidApi (or rapid_api) transport option and require only the RapidAPI subscription key; the SDK supplies the required RapidAPI headers.
Browser support
The public gateway supports cross-origin resource sharing (CORS), so browser-based applications can call the direct API straight from the client with the TypeScript SDK (@timelogic/direct-api) using standard fetch — no proxy layer or backend required. Signature and quota response headers are exposed to browsers so signed responses can still be verified client-side. Keep API keys out of client-side bundles; prefer short-lived or scoped credentials for browser use.
TypeScript quick start
npm install @timelogic/direct-api
import { TimeApi, createConfiguration } from '@timelogic/direct-api'; const configuration = createConfiguration({ apiKey: process.env.TIMELOGIC_API_KEY!, }); const api = new TimeApi(configuration); const response = await api.getCurrentTime({ tz: 'America/New_York' }); console.log(response);
See the TypeScript package README for RapidAPI usage and the complete endpoint list.
Swift
Swift Package Manager consumes the repository directly:
dependencies: [ .package(url: "https://github.com/TimeLogic-API-LLC/timelogic-api-sdks.git", from: "1.0.1") ]
The library product and module are both named TimeLogicAPI.
Development
Requirements for full repository validation are Node.js 22+, Docker Desktop, and the toolchain for any language you want to build locally.
npm ci npm run validate npm run generate npm run verify-generated npm run test:contract
Without TIMELOGIC_SDK_TEST_API_KEY, live HTTP checks are skipped and static contract checks still run. Use a dedicated, low-quota test key for local live checks; never use a master, billing, or unrestricted production key.
Releases
Releases use immutable vMAJOR.MINOR.PATCH tags. Each registry has an independent job, so a failure in one publisher does not block the others. See PUBLISHING.md for registry setup, trusted publishing, and release verification.
Security and support
Please report security issues privately using SECURITY.md. For general questions or bug reports, use the issue tracker.
Licensed under the Unlicense.