A modern, interactive timezone converter that works just like timeanddate.com. Each timezone has its own editable time input, and when you change any time, all others update automatically with the edited timezone highlighted as the reference.
- 5 configurable timezones: Chile, United States (NY), Argentina, Colombia, Dominican Republic
- Individual time inputs for each timezone
- Any timezone can be the source - just edit any time input
- Real-time updates: Change any time and all others update instantly
- Visual highlighting: The edited timezone is highlighted as the active reference
- Automatic DST handling: Daylight Saving Time is calculated automatically
- UTC offset display: Shows current UTC offset for each timezone
- timeanddate.com inspired design
- Responsive layout: Works perfectly on desktop, tablet, and mobile
- Smooth animations: Hover effects and transitions
- Status indicators: Clear feedback on which timezone is being used as reference
- No external dependencies: 100% client-side with
Intl.DateTimeFormat - No backend: Ideal for GitHub Pages
- Error handling: Clear messages in the UI
- Auto-detection: Detects and displays your local timezone
Publish with GitHub Pages (see section below) and your demo will be available at https://paul0li.github.io/timezone-project/.
- Load: Displays current time in Chile as default reference
- Edit: Click any time input to change it
- Convert: All other timezones update automatically
- Highlight: The edited timezone is visually highlighted
- Repeat: Edit any other timezone to make it the new reference
- None required to use the static version
- Optional: Python 3 or Node.js to serve
docs/locally
Option 1 (no install):
# On macOS or any system with Python 3
python3 -m http.server 5500 -d docs
# Open http://localhost:5500Option 2 (with Node):
npx serve docs
# Open the URL shown by the command (e.g. http://localhost:3000)timezone-project/
βββ docs/ # Static site for GitHub Pages
β βββ index.html # Main interface
β βββ script.js # 100% client-side time conversion logic
β βββ styles.css # Modern styling
β βββ .nojekyll # Avoid Jekyll processing
βββ README.md # This file
βββ LICENSE
βββ .gitignore
This build is 100% static and exposes no endpoints. All conversions run in the browser using the Intl.DateTimeFormat API, including proper DST handling.
| Country | City | IANA Identifier | UTC Offset* |
|---|---|---|---|
| π¨π± Chile | Santiago | America/Santiago |
UTC-3/-4 |
| πΊπΈ United States | New York | America/New_York |
UTC-5/-4 |
| π¦π· Argentina | Buenos Aires | America/Argentina/Buenos_Aires |
UTC-3 |
| π¨π΄ Colombia | BogotΓ‘ | America/Bogota |
UTC-5 |
| π©π΄ Dominican Republic | Santo Domingo | America/Santo_Domingo |
UTC-4 |
*UTC offsets vary due to Daylight Saving Time
- Update the timezone data in
docs/script.js:
const timezoneData = {
// Add your timezone here
"Europe/London": {
name: "United Kingdom",
location: "London",
country: "GB",
},
// ... existing timezones
};- Add HTML card in
docs/index.html:
<div class="timezone-card" data-timezone="Europe/London">
<div class="card-header">
<div class="flag-container" id="flag-Europe/London"></div>
<div class="timezone-info">
<div class="timezone-name">United Kingdom</div>
<div class="timezone-location">London</div>
</div>
</div>
<div class="time-section">
<input type="time" class="time-input" data-timezone="Europe/London" step="60" />
<div class="ampm-display">AM</div>
<div class="timezone-offset" data-timezone="Europe/London">UTCΒ±0</div>
</div>
</div>- No server changes needed. Everything runs in the browser.
The app uses CSS custom properties for easy theming. Key variables:
:root {
--primary-color: #667eea;
--secondary-color: #764ba2;
--border-color: #e1e8ed;
--background-color: #f8f9fa;
}This project can run fully static thanks to client-side timezone conversion using the Intl API. A prebuilt static copy lives in the docs/ directory for GitHub Pages.
Steps:
- Commit and push the
docs/directorygit add docs/ git commit -m "chore: add docs/ for GitHub Pages" git push origin main - In GitHub, go to
SettingsβPages - Under "Build and deployment":
- Source:
Deploy from a branch - Branch:
mainand folder:/docs
- Source:
- Save. Your site will be available at:
- User/Org site:
https://<your-username>.github.io/<repo-name>/ - Project Pages custom domain if configured.
- User/Org site:
Notes:
- The static app references assets with relative paths (
styles.css,script.js), so it works under any subpath. - A
.nojekyllfile is included indocs/to prevent Jekyll processing.
No backend is required. Publish the docs/ folder via GitHub Pages as described above. For local preview, serve docs/ with any static server.
Contributions are welcome! Here's how you can help:
- Use the Issues tab
- Include steps to reproduce
- Mention your browser and OS
- Check existing issues first
- Describe the feature and use case
- Consider implementation complexity
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test thoroughly
- Submit a pull request with clear description
- Code Style: Use consistent indentation and naming
- Comments: Document complex logic
- Testing: Test on multiple browsers and devices
- Responsive: Ensure mobile compatibility
This project is licensed under the MIT License - see the LICENSE file for details.