<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Timestamp Converter - Unix, ISO 8601, RFC 2822 | Free Online Tool</title>
    <link rel="icon" type="image/svg+xml" href="favicon.svg">
    <link rel="canonical" href="https://timestampconverter.net/">

    <!-- Primary Meta Tags -->
    <meta name="title" content="Timestamp Converter - Unix, ISO 8601, RFC 2822 | Free Online Tool">
    <meta name="description" content="Free universal timestamp converter for developers. Instantly convert Unix timestamps, ISO 8601, RFC 2822, and more. Auto-detects format, timezone support, date math, bulk conversion. No ads, no tracking.">
    <meta name="keywords" content="timestamp converter, unix timestamp converter, epoch converter, unix time converter, iso 8601 converter, rfc 2822 converter, utc converter, date converter, time converter, epoch to date, unix to date, timestamp to date, online timestamp converter">
    <meta name="author" content="Timestamp Converter">
    <meta name="robots" content="index, follow">
    <meta name="language" content="English">

    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://timestampconverter.net/">
    <meta property="og:title" content="Timestamp Converter - Free Unix & ISO 8601 Converter">
    <meta property="og:description" content="Convert any timestamp format instantly. Auto-detection, 400+ timezones, date math, bulk conversion. Free tool for developers.">
    <meta property="og:image" content="https://timestampconverter.net/og-image.png">
    <meta property="og:site_name" content="Timestamp Converter">

    <!-- Twitter -->
    <meta property="twitter:card" content="summary_large_image">
    <meta property="twitter:url" content="https://timestampconverter.net/">
    <meta property="twitter:title" content="Timestamp Converter - Free Unix & ISO 8601 Converter">
    <meta property="twitter:description" content="Convert any timestamp format instantly. Auto-detection, 400+ timezones, date math, bulk conversion. Free tool for developers.">
    <meta property="twitter:image" content="https://timestampconverter.net/og-image.png">

    <!-- Schema.org structured data -->
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "WebApplication",
        "name": "Timestamp Converter",
        "alternateName": ["Unix Timestamp Converter", "Epoch Converter", "ISO 8601 Converter"],
        "description": "Free universal timestamp converter for developers. Convert Unix timestamps, ISO 8601, RFC 2822, and more with auto-detection, timezone support, and date math.",
        "url": "https://timestampconverter.net/",
        "applicationCategory": "DeveloperApplication",
        "operatingSystem": "Any",
        "browserRequirements": "Requires JavaScript",
        "offers": {
            "@type": "Offer",
            "price": "0",
            "priceCurrency": "USD"
        },
        "featureList": [
            "Auto-detect timestamp formats",
            "Unix timestamp conversion",
            "ISO 8601 conversion",
            "RFC 2822 conversion",
            "Timezone conversion with 400+ timezones",
            "Date math calculations",
            "Duration calculator",
            "Bulk timestamp conversion",
            "Dark and light mode"
        ],
        "screenshot": "https://timestampconverter.net/og-image.png",
        "softwareHelp": {
            "@type": "CreativeWork",
            "url": "https://timestampconverter.net/blog.html"
        }
    }
    </script>

    <!-- FAQ Schema for rich results -->
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "FAQPage",
        "mainEntity": [
            {
                "@type": "Question",
                "name": "What is a Unix timestamp?",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": "A Unix timestamp (also known as Epoch time or POSIX time) is the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC. It's a widely used format for representing dates and times in programming."
                }
            },
            {
                "@type": "Question",
                "name": "How do I convert a Unix timestamp to a readable date?",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": "Simply paste your Unix timestamp into the input field on this page. The converter will automatically detect it and show you the date in multiple formats including ISO 8601, RFC 2822, and human-readable format."
                }
            },
            {
                "@type": "Question",
                "name": "What timestamp formats does this converter support?",
                "acceptedAnswer": {
                    "@type": "Answer",
                    "text": "This converter supports Unix timestamps (seconds and milliseconds), ISO 8601, RFC 2822, and various human-readable date formats. It auto-detects the format so you don't need to specify it."
                }
            }
        ]
    }
    </script>

    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <header>
            <div class="header-top">
                <h1>Timestamp Converter</h1>
                <button id="theme-toggle" class="icon-btn" aria-label="Toggle dark mode">
                    <span class="sun-icon">&#9728;</span>
                    <span class="moon-icon">&#9790;</span>
                </button>
            </div>
            <p class="tagline">Convert Unix timestamps, ISO 8601, and more. Paste any format - we'll detect it automatically.</p>
            <p class="timezone-display">Your Timezone: <span id="user-timezone"></span></p>
        </header>

        <main>
            <section class="input-section">
                <label for="timestamp-input">Input:</label>
                <div class="input-row">
                    <input type="text" id="timestamp-input" placeholder="Paste or type any timestamp" autocomplete="off" aria-describedby="detected-format">
                    <button id="now-btn" class="btn btn-primary">Now</button>
                    <button id="clear-btn" class="btn btn-secondary">Clear</button>
                </div>
                <div class="presets-row">
                    <span class="presets-label">Quick:</span>
                    <button class="preset-btn" data-preset="start-of-day">Start of Day</button>
                    <button class="preset-btn" data-preset="end-of-day">End of Day</button>
                    <button class="preset-btn" data-preset="start-of-week">Start of Week</button>
                    <button class="preset-btn" data-preset="start-of-month">Start of Month</button>
                    <button class="preset-btn" data-preset="start-of-year">Start of Year</button>
                </div>
                <p id="detected-format" class="detected-format" aria-live="polite"></p>
            </section>

            <section class="results-section" id="results-section">
                <div class="results-header">
                    <h2>Results</h2>
                    <div class="results-actions">
                        <button id="copy-all-btn" class="btn btn-small" title="Copy all formats as JSON">Copy All</button>
                        <button id="share-btn" class="btn btn-small" title="Copy shareable URL">Share</button>
                    </div>
                </div>
                <p class="click-hint" id="click-hint">Click any value to use as input</p>
                <div class="results-grid">
                    <div class="result-row">
                        <span class="result-label">Unix (seconds)</span>
                        <span class="result-value clickable" id="unix-seconds" tabindex="0" role="button">-</span>
                        <button class="copy-btn" data-target="unix-seconds" aria-label="Copy Unix seconds">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <div class="result-row">
                        <span class="result-label">Unix (milliseconds)</span>
                        <span class="result-value clickable" id="unix-ms" tabindex="0" role="button">-</span>
                        <button class="copy-btn" data-target="unix-ms" aria-label="Copy Unix milliseconds">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <div class="result-row">
                        <span class="result-label">ISO 8601 (UTC)</span>
                        <span class="result-value clickable" id="iso-utc" tabindex="0" role="button">-</span>
                        <button class="copy-btn" data-target="iso-utc" aria-label="Copy ISO 8601 UTC">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <div class="result-row">
                        <span class="result-label">ISO 8601 (Local)</span>
                        <span class="result-value clickable" id="iso-local" tabindex="0" role="button">-</span>
                        <button class="copy-btn" data-target="iso-local" aria-label="Copy ISO 8601 Local">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <div class="result-row">
                        <span class="result-label">RFC 2822</span>
                        <span class="result-value clickable" id="rfc2822" tabindex="0" role="button">-</span>
                        <button class="copy-btn" data-target="rfc2822" aria-label="Copy RFC 2822">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <div class="result-row">
                        <span class="result-label">Human Readable</span>
                        <span class="result-value clickable" id="human-readable" tabindex="0" role="button">-</span>
                        <button class="copy-btn" data-target="human-readable" aria-label="Copy Human Readable">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <div class="result-row">
                        <span class="result-label">Relative Time</span>
                        <span class="result-value" id="relative-time">-</span>
                        <button class="copy-btn" data-target="relative-time" aria-label="Copy Relative Time">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                </div>
            </section>

            <section class="timezone-section">
                <h2>Timezone Converter</h2>
                <div class="timezone-row">
                    <div class="custom-select" id="timezone-dropdown">
                        <button class="select-trigger" id="timezone-trigger" aria-haspopup="listbox" aria-expanded="false">
                            <span class="select-value">Select timezone...</span>
                            <span class="select-arrow">&#9662;</span>
                        </button>
                        <div class="select-dropdown" id="timezone-list" role="listbox" aria-label="Timezones">
                            <!-- Options populated by JS -->
                        </div>
                    </div>
                </div>
                <div class="result-row" id="tz-result-row" style="display: none;">
                    <span class="result-label" id="tz-label">-</span>
                    <span class="result-value" id="tz-result">-</span>
                    <button class="copy-btn" data-target="tz-result" aria-label="Copy timezone result">
                        <span class="copy-icon">&#128203;</span>
                    </button>
                </div>
            </section>

            <section class="date-math-section">
                <h2>Date Math</h2>
                <p class="section-hint">Add or subtract time from the current result</p>
                <div class="date-math-grid">
                    <div class="math-input-group">
                        <label for="math-years">Years</label>
                        <div class="math-input-row">
                            <button class="math-btn" data-unit="year" data-op="subtract">-</button>
                            <input type="number" id="math-years" value="0" >
                            <button class="math-btn" data-unit="year" data-op="add">+</button>
                        </div>
                    </div>
                    <div class="math-input-group">
                        <label for="math-months">Months</label>
                        <div class="math-input-row">
                            <button class="math-btn" data-unit="month" data-op="subtract">-</button>
                            <input type="number" id="math-months" value="0" >
                            <button class="math-btn" data-unit="month" data-op="add">+</button>
                        </div>
                    </div>
                    <div class="math-input-group">
                        <label for="math-days">Days</label>
                        <div class="math-input-row">
                            <button class="math-btn" data-unit="day" data-op="subtract">-</button>
                            <input type="number" id="math-days" value="0" >
                            <button class="math-btn" data-unit="day" data-op="add">+</button>
                        </div>
                    </div>
                    <div class="math-input-group">
                        <label for="math-hours">Hours</label>
                        <div class="math-input-row">
                            <button class="math-btn" data-unit="hour" data-op="subtract">-</button>
                            <input type="number" id="math-hours" value="0" >
                            <button class="math-btn" data-unit="hour" data-op="add">+</button>
                        </div>
                    </div>
                    <div class="math-input-group">
                        <label for="math-minutes">Minutes</label>
                        <div class="math-input-row">
                            <button class="math-btn" data-unit="minute" data-op="subtract">-</button>
                            <input type="number" id="math-minutes" value="0" >
                            <button class="math-btn" data-unit="minute" data-op="add">+</button>
                        </div>
                    </div>
                    <div class="math-input-group">
                        <label for="math-seconds">Seconds</label>
                        <div class="math-input-row">
                            <button class="math-btn" data-unit="second" data-op="subtract">-</button>
                            <input type="number" id="math-seconds" value="0" >
                            <button class="math-btn" data-unit="second" data-op="add">+</button>
                        </div>
                    </div>
                </div>
                <div class="math-result" id="math-result" style="display: none;">
                    <div class="result-row">
                        <span class="result-label">Result</span>
                        <span class="result-value" id="math-result-value">-</span>
                        <button class="copy-btn" data-target="math-result-value" aria-label="Copy math result">
                            <span class="copy-icon">&#128203;</span>
                        </button>
                    </div>
                    <button id="use-math-result" class="btn btn-small">Use as Input</button>
                </div>
            </section>

            <section class="duration-section">
                <h2>Duration Calculator</h2>
                <p class="section-hint">Calculate the difference between two timestamps</p>
                <div class="duration-inputs">
                    <div class="duration-input-group">
                        <label for="duration-start">Start</label>
                        <div class="duration-input-row">
                            <input type="text" id="duration-start" placeholder="First timestamp">
                            <button class="btn btn-small" id="duration-start-now">Now</button>
                        </div>
                        <span class="duration-detected" id="duration-start-detected"></span>
                    </div>
                    <div class="duration-input-group">
                        <label for="duration-end">End</label>
                        <div class="duration-input-row">
                            <input type="text" id="duration-end" placeholder="Second timestamp">
                            <button class="btn btn-small" id="duration-end-now">Now</button>
                        </div>
                        <span class="duration-detected" id="duration-end-detected"></span>
                    </div>
                </div>
                <div class="duration-result" id="duration-result" style="display: none;">
                    <div class="duration-result-grid">
                        <div class="duration-stat">
                            <span class="duration-stat-value" id="duration-human">-</span>
                            <span class="duration-stat-label">Human Readable</span>
                        </div>
                        <div class="duration-stat">
                            <span class="duration-stat-value" id="duration-days">-</span>
                            <span class="duration-stat-label">Total Days</span>
                        </div>
                        <div class="duration-stat">
                            <span class="duration-stat-value" id="duration-hours">-</span>
                            <span class="duration-stat-label">Total Hours</span>
                        </div>
                        <div class="duration-stat">
                            <span class="duration-stat-value" id="duration-minutes">-</span>
                            <span class="duration-stat-label">Total Minutes</span>
                        </div>
                        <div class="duration-stat">
                            <span class="duration-stat-value" id="duration-seconds">-</span>
                            <span class="duration-stat-label">Total Seconds</span>
                        </div>
                        <div class="duration-stat">
                            <span class="duration-stat-value" id="duration-ms">-</span>
                            <span class="duration-stat-label">Total Milliseconds</span>
                        </div>
                    </div>
                </div>
            </section>

            <section class="bulk-section">
                <h2>Bulk Conversion</h2>
                <p class="section-hint">Paste multiple timestamps (one per line)</p>
                <textarea id="bulk-input" placeholder="1706745600&#10;2024-01-31T12:00:00Z&#10;January 31, 2024" rows="4"></textarea>
                <div class="bulk-actions">
                    <button id="bulk-convert" class="btn btn-primary">Convert All</button>
                    <button id="bulk-clear" class="btn btn-secondary">Clear</button>
                    <button id="bulk-copy" class="btn btn-small" style="display: none;">Copy Results</button>
                </div>
                <div class="bulk-results" id="bulk-results" style="display: none;">
                    <table class="bulk-table">
                        <thead>
                            <tr>
                                <th>Input</th>
                                <th>Unix (s)</th>
                                <th>ISO 8601 (UTC)</th>
                                <th>Human Readable</th>
                            </tr>
                        </thead>
                        <tbody id="bulk-table-body">
                        </tbody>
                    </table>
                </div>
            </section>
        </main>

        <footer>
            <p>Free timestamp converter for developers. No tracking, no ads, just fast conversions.</p>
            <p>Browse:
                <a href="/convert/" class="footer-link">Format Conversions</a> &middot;
                <a href="/timezone/" class="footer-link">Timezones</a> &middot;
                <a href="/language/" class="footer-link">By Language</a> &middot;
                <a href="/year/" class="footer-link">By Year</a> &middot;
                <a href="/date/" class="footer-link">By Date</a> &middot;
                <a href="/cron/" class="footer-link">Cron</a> &middot;
                <a href="/duration/" class="footer-link">Date Math</a> &middot;
                <a href="/days-between/" class="footer-link">Days Between</a>
            </p>
            <p><a href="/blog.html" class="footer-link">Learn about timestamp formats</a></p>
            <p class="sister-site">Also check out: <a href="https://jsondifference.com/" class="footer-link" rel="noopener">JSON Difference</a> - Compare and diff JSON files online</p>
        </footer>
    </div>

    <div id="toast" class="toast" aria-live="assertive"></div>

    <!-- Day.js CDN -->
    <script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/utc.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/timezone.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/duration.js"></script>
    <script src="app.js"></script>
</body>
</html>
