惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
S
SegmentFault 最新的问题
V
Visual Studio Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
美团技术团队
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
量子位
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
博客园 - 叶小钗
月光博客
月光博客
P
Proofpoint News Feed
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
World Clock vs. Timezone Calculator: Why Browser Extensio...
Weather Cloc · 2026-05-04 · via DEV Community

Weather Clock Dash

Every developer who works with distributed teams has felt the pain: it's 9:15am and you need to schedule a meeting. You open a timezone converter, switch between tabs, do the math, close the calculator. You do this 5 times a day.

There's a better way.

The Problem with Current Solutions

Dedicated timezone apps (like World Time Buddy, Every Time Zone) are great for scheduling, but they require navigation to a separate website. That's a context switch.

Your OS clock shows one timezone. You can add multiple clocks on macOS/Windows, but they're buried in menus.

Google's timezone tool requires typing a search. Another context switch.

Browser extension clock widgets appear every time you open a new tab. Zero navigation required.

What a New Tab Clock Should Show

Here's what I found myself actually needing:

San Francisco:  9:15 AM  Wednesday
New York:      12:15 PM  Wednesday  
London:         5:15 PM  Wednesday
Tokyo:          2:15 AM  Thursday  ← crossed midnight!

Enter fullscreen mode Exit fullscreen mode

That day-change indicator is critical. Seeing that it's Thursday in Tokyo when it's Wednesday here prevents the "oh no, they're asleep" mistake.

Technical Implementation

The JavaScript Intl API makes this surprisingly clean:

function formatClock(timezone, label) {
  const now = new Date();

  const timeFormatter = new Intl.DateTimeFormat('en-US', {
    timeZone: timezone,
    hour: 'numeric',
    minute: '2-digit',
    hour12: true
  });

  const dateFormatter = new Intl.DateTimeFormat('en-US', {
    timeZone: timezone,
    weekday: 'long',
    month: 'short',
    day: 'numeric'
  });

  return {
    label,
    time: timeFormatter.format(now),
    date: dateFormatter.format(now),
    isNextDay: isNextDay(timezone)
  };
}

function isNextDay(timezone) {
  const local = new Date();
  const remoteDate = new Date(local.toLocaleString('en-US', { timeZone: timezone }));
  const localDate = new Date(local.toLocaleString('en-US'));
  return remoteDate.getDate() !== localDate.getDate();
}

Enter fullscreen mode Exit fullscreen mode

The Intl.DateTimeFormat API handles all the timezone conversion natively. No libraries needed.

Picking Timezones

The IANA timezone database is the standard. Some common IDs:

const COMMON_ZONES = {
  'US/Pacific':  'America/Los_Angeles',
  'US/Eastern':  'America/New_York',
  'London':      'Europe/London',
  'Central EU':  'Europe/Berlin',
  'India':       'Asia/Kolkata',
  'Singapore':   'Asia/Singapore',
  'Tokyo':       'Asia/Tokyo',
  'Sydney':      'Australia/Sydney'
};

Enter fullscreen mode Exit fullscreen mode

Note that Asia/Kolkata (India Standard Time) is UTC+5:30 — a non-whole-hour offset. The Intl API handles this correctly.

Building a Searchable Timezone List

One UX challenge: letting users pick timezones. The full IANA list has 600+ entries. You need to show common ones and allow search.

// Simplified searchable timezone picker
function searchTimezones(query) {
  return Intl.supportedValuesOf('timeZone')
    .filter(tz => tz.toLowerCase().includes(query.toLowerCase()))
    .slice(0, 20); // limit results
}

Enter fullscreen mode Exit fullscreen mode

Intl.supportedValuesOf('timeZone') returns all IANA timezones supported by the browser. In modern browsers this is comprehensive.

The New Tab Advantage

The reason a clock belongs in your new tab specifically:

  1. You open a new tab naturally when starting a task
  2. The moment before you start doing something is when you're most likely to think "I should check if Tokyo is awake"
  3. Zero friction — the info is just there

Weather & Clock Dashboard implements exactly this. Multiple configurable world clocks with timezone labels, updating every minute, visible every time you open a tab.


The source code (MIT) is on GitHub. The timezone implementation is in dashboard.js if you want to see a working example.