<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>BD to Global Time Converter</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
            background: linear-gradient(to right, #6a11cb, #2575fc);
            color: white;
        }
        input, select, button {
            padding: 12px;
            margin: 10px;
            border-radius: 8px;
            border: 2px solid #fff;
            font-size: 16px;
            width: 100%;
            max-width: 400px;
        }
        input, select {
            background-color: #ffffff;
            color: #000000;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
        button {
            background-color: #ff6f61;
            color: white;
            cursor: pointer;
            transition: background-color 0.3s;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
        button:hover {
            background-color: #ff3b2e;
        }
        h1 {
            font-size: 2.8rem;
            margin-bottom: 20px;
            text-transform: none;
            letter-spacing: 1px;
            color: #000000;
        }
        h2 {
            margin-top: 20px;
            font-size: 1.8rem;
            color: #ff0000;
        }
        .container {
            padding: 25px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            display: inline-block;
            width: 90%;
            max-width: 600px;
            margin: 0 auto;
        }
        .heading {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: #ff0000;
            font-weight: normal;
        }

        /* Mobile responsiveness */
        @media (max-width: 600px) {
            h1 {
                font-size: 2rem;
            }
            .container {
                width: 95%;
                padding: 20px;
            }
            input, select, button {
                font-size: 14px;
            }
        }
    </style>
</head>
<body>
    <h1>Bangladesh to Global Time Converter</h1>
    <div class="container">
        <div class="heading">Enter BD Time:</div>
        <input type="time" id="bd-time" required><br>

        <label for="global-timezone">Select Country Time Zone:</label><br>
        <select id="global-timezone">
            <option value="-5">USA (EST - Eastern Standard Time)</option>
            <option value="-6">USA (CST - Central Standard Time)</option>
            <option value="-7">USA (MST - Mountain Standard Time)</option>
            <option value="-8">USA (PST - Pacific Standard Time)</option>
            <option value="0">UK (GMT - Greenwich Mean Time)</option>
            <option value="+1">Germany (CET - Central European Time)</option>
            <option value="+2">Egypt (EET - Eastern European Time)</option>
            <option value="+3">Russia (MSK - Moscow Standard Time)</option>
            <option value="+5.5">India (IST - Indian Standard Time)</option>
            <option value="+5.75">Nepal (NPT - Nepal Time)</option>
            <option value="+6">Bangladesh (BST - Bangladesh Standard Time)</option>
            <option value="+8">China (CST - China Standard Time)</option>
            <option value="+9">Japan (JST - Japan Standard Time)</option>
            <option value="-3">Argentina (ART - Argentina Time)</option>
            <option value="+10">Australia (AET - Australian Eastern Time)</option>
        </select><br>

        <button onclick="convertTime()">Convert</button>

        <h2 id="result"></h2>
    </div>

    <script>
        function setCurrentBDTime() {
            const now = new Date();
            const bdTime = new Date(now.getTime() + 6 * 60 * 60 * 1000); // UTC+6 for BDT

            const hours = bdTime.getHours().toString().padStart(2, '0');
            const minutes = bdTime.getMinutes().toString().padStart(2, '0');

            document.getElementById('bd-time').value = `${hours}:${minutes}`;
        }

        function convertTime() {
            const bdTimeInput = document.getElementById('bd-time').value;
            const globalTimezoneOffset = parseFloat(document.getElementById('global-timezone').value);
            const timeZoneName = document.getElementById('global-timezone').options[document.getElementById('global-timezone').selectedIndex].text;

            if (!bdTimeInput) {
                alert('Please enter a valid Bangladesh time.');
                return;
            }

            const [hours, minutes] = bdTimeInput.split(':').map(Number);
            const bdDate = new Date();

            bdDate.setHours(hours);
            bdDate.setMinutes(minutes);

            // Convert BDT (UTC+6) to UTC
            const utcTime = bdDate.getTime() - 6 * 60 * 60 * 1000;

            // Convert UTC to the selected time zone
            const globalTime = new Date(utcTime + globalTimezoneOffset * 60 * 60 * 1000);

            let globalHours = globalTime.getHours();
            const globalMinutes = globalTime.getMinutes().toString().padStart(2, '0');
            const amPm = globalHours >= 12 ? 'PM' : 'AM';
            globalHours = globalHours % 12 || 12;

            document.getElementById('result').innerText = `${timeZoneName} Time: ${globalHours}:${globalMinutes} ${amPm}`;
        }

        // Set the initial Bangladesh time on page load
        window.onload = setCurrentBDTime;
    </script>
</body>
</html>

				
			

Stop wasting time and money!!

Transform your online presence and empower your brand today with our unbeatable, innovative, dynamic online advertising services- let us revolutionize your online advertising approach.

Open chat
1
Need Help?
Hi, How Can I Help You?