Skip to content

Relative Time Formatter is a tool for converting timestamps and dates to human-readable relative time formats like '2 hours ago' or 'in 3 days'. It supports multiple styles and custom reference times for flexible time representation.

License

Notifications You must be signed in to change notification settings

apiverve/relativetimeformatter-api

Relative Time Formatter API

Relative Time Formatter is a tool for converting timestamps and dates to human-readable relative time formats like '2 hours ago' or 'in 3 days'. It supports multiple styles and custom reference times for flexible time representation.

License: MIT API Status Method Platform

Available on: npm NuGet PyPI JitPack


Quick Start

Using JavaScript

async function callRelativeTimeFormatterAPI() {
    try {
        const params = new URLSearchParams({
            timestamp: '1609459200',
            date: '2024-01-01T00:00:00Z',
            reference: '2024-06-01T00:00:00Z',
            style: 'short'
        });

        const response = await fetch(`https://api.apiverve.com/v1/relativetimeformatter?${params}`, {
            method: 'GET',
            headers: {
                'x-api-key': 'YOUR_API_KEY_HERE'
            }
        });

        const data = await response.json();
        console.log(data);
    } catch (error) {
        console.error('Error:', error);
    }
}

callRelativeTimeFormatterAPI();

Using cURL

curl -X GET "https://api.apiverve.com/v1/relativetimeformatter?param=value" \
  -H "x-api-key: YOUR_API_KEY_HERE"

Get your API key: https://apiverve.com

📁 For more examples, see the examples folder


Installation

Choose your preferred programming language:

📦 NPM (JavaScript/Node.js)

npm install @apiverve/relativetimeformatter

View NPM Package → | Package Code →


🔷 NuGet (.NET/C#)

dotnet add package APIVerve.API.RelativeTimeFormatter

View NuGet Package → | Package Code →


🐍 Python (PyPI)

pip install apiverve-relativetimeformatter

View PyPI Package → | Package Code →


🤖 Android (JitPack)

implementation 'com.github.apiverve:relativetimeformatter-api:1.0.0'

Package Code →


Features

Multi-platform support - Use the same API across Node.js, .NET, Python, Android, and browsers ✅ Simple authentication - Just add your API key in the request header ✅ Comprehensive documentation - Full examples and API reference available ✅ Production-ready - Used by developers worldwide


Documentation

📚 Full API Documentation: https://docs.apiverve.com/ref/relativetimeformatter


Use Cases

Common use cases for the Relative Time Formatter API:

  • ✅ Integration into web applications
  • ✅ Mobile app development
  • ✅ Data analysis and reporting
  • ✅ Automation workflows
  • ✅ Microservices architecture

API Reference

Authentication

All requests require an API key in the header:

x-api-key: YOUR_API_KEY_HERE

Get your API key: https://apiverve.com

Response Format

All responses are JSON with this structure:

{
  "status": "ok",
  "data": { ... }
}

Support & Community


Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.


Security

For security concerns, please review our Security Policy.


License

This project is licensed under the MIT License - see the LICENSE file for details.


Acknowledgments

Built with ❤️ by APIVerve

Copyright © 2025 APIVerve. All rights reserved.

About

Relative Time Formatter is a tool for converting timestamps and dates to human-readable relative time formats like '2 hours ago' or 'in 3 days'. It supports multiple styles and custom reference times for flexible time representation.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published