<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Luke Bowers</title>
    <description>The latest articles on Forem by Luke Bowers (@luke_bowers).</description>
    <link>https://forem.com/luke_bowers</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1835366%2F9350ee72-e314-4166-bcbc-fe9f52993b29.jpg</url>
      <title>Forem: Luke Bowers</title>
      <link>https://forem.com/luke_bowers</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/luke_bowers"/>
    <language>en</language>
    <item>
      <title>Time Zone Conversions in JavaScript (date-fns + date-fns-tz): A Practical Guide</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Sun, 15 Feb 2026 00:00:00 +0000</pubDate>
      <link>https://forem.com/luke_bowers/time-zone-conversions-in-javascript-date-fns-date-fns-tz-a-practical-guide-lmk</link>
      <guid>https://forem.com/luke_bowers/time-zone-conversions-in-javascript-date-fns-date-fns-tz-a-practical-guide-lmk</guid>
      <description>&lt;p&gt;If you've ever shipped a scheduling feature, API integration, incident timeline, or distributed worker queue, you already know this: time zone bugs are rarely loud, but they are expensive. ⏱️&lt;/p&gt;

&lt;p&gt;A timestamp looks fine in dev, then support tickets show up from users in Sydney, London, or Toronto. A log line appears “out of order.” A meeting reminder fires an hour late after a DST shift. 😵‍💫&lt;/p&gt;

&lt;p&gt;This guide is for developers who need reliable, practical patterns—not theory—for timezone conversion in JavaScript. We'll use &lt;code&gt;date-fns&lt;/code&gt; + &lt;code&gt;date-fns-tz&lt;/code&gt; to solve the most common production cases, including the search intent behind queries like &lt;strong&gt;convert utc to local time javascript&lt;/strong&gt; and &lt;strong&gt;date-fns-tz formatInTimeZone&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you're still grounding terminology, it's worth skimming &lt;a href="https://www.pastetime.com/blog/utc-vs-gmt" rel="noopener noreferrer"&gt;UTC vs GMT&lt;/a&gt; and &lt;a href="https://www.pastetime.com/blog/understanding-timestamps" rel="noopener noreferrer"&gt;Understanding Timestamps&lt;/a&gt; first.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 Introduction: the two kinds of “time zone conversion”
&lt;/h2&gt;

&lt;p&gt;Most bugs happen because teams mix up two different jobs.&lt;/p&gt;

&lt;h3&gt;
  
  
  👀 A) UTC timestamp → viewer's local time (display problem)
&lt;/h3&gt;

&lt;p&gt;You already have a UTC moment from your API, DB, or logs, such as &lt;code&gt;2026-02-11T03:00:00Z&lt;/code&gt;. You want each user to see that same moment in &lt;em&gt;their&lt;/em&gt; local zone.&lt;/p&gt;

&lt;p&gt;This is mostly a rendering concern.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏙️ B) UTC timestamp → specific city time (meeting/flight problem)
&lt;/h3&gt;

&lt;p&gt;You need to show what that UTC moment is in a target city (for planning, operations, travel, handoffs, or release windows). For example, “what is 03:00 UTC in Sydney?”&lt;/p&gt;

&lt;p&gt;For quick city checks, teams often use a converter like &lt;a href="https://www.pastetime.com/utc-to/london" rel="noopener noreferrer"&gt;UTC to London time&lt;/a&gt; or &lt;a href="https://www.pastetime.com/utc-to/sydney" rel="noopener noreferrer"&gt;UTC to Sydney time&lt;/a&gt; during incident response.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⏳ What breaks naive math: DST
&lt;/h3&gt;

&lt;p&gt;You cannot safely solve these problems with “UTC plus fixed offset.” 🚫&lt;/p&gt;

&lt;p&gt;Offsets change during the year for many places because of daylight saving transitions. Some zones shift by one hour, some don't shift at all, and the transition dates differ by country.&lt;/p&gt;

&lt;p&gt;So if your logic is &lt;code&gt;utc + 10&lt;/code&gt;, it'll eventually lie. 📉&lt;/p&gt;

&lt;h2&gt;
  
  
  ✅ The one rule that prevents 80% of bugs: store UTC, convert at the edges
&lt;/h2&gt;

&lt;p&gt;If your system has one timezone rule, make it this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Store canonical moments in UTC. Convert only when entering or leaving your system boundaries.&lt;/strong&gt; ✅&lt;/p&gt;

&lt;p&gt;Where this applies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Database&lt;/strong&gt;: Persist event instants in UTC (&lt;code&gt;TIMESTAMPTZ&lt;/code&gt;, ISO with &lt;code&gt;Z&lt;/code&gt;, or epoch).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;APIs&lt;/strong&gt;: Send UTC in payloads unless you explicitly need local context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logging/observability&lt;/strong&gt;: Keep UTC for cross-region ordering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI/email/export&lt;/strong&gt;: Convert to target timezone at display time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And one non-negotiable rule:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Never store local times without zone/offset context.&lt;/strong&gt; 🔒&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"2026-10-25 01:30"&lt;/code&gt; is ambiguous in many zones during DST end. If a user enters local time, store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;local date/time string,&lt;/li&gt;
&lt;li&gt;IANA timezone (for example, &lt;code&gt;Europe/London&lt;/code&gt;), and&lt;/li&gt;
&lt;li&gt;the resolved UTC instant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For API-focused patterns, see &lt;a href="https://www.pastetime.com/blog/best-practices-timezone-handling-apis" rel="noopener noreferrer"&gt;Best Practices for Timezone Handling in APIs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌐 Converting UTC → a specific city time (the safe way)
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;formatInTimeZone&lt;/code&gt; from &lt;code&gt;date-fns-tz&lt;/code&gt;. It formats a UTC instant directly in the target IANA timezone.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;formatInTimeZone&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date-fns-tz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;utcIso&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2026-02-11T03:00:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zones&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Australia/Sydney&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Europe/London&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Asia/Singapore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;timeZone&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;zones&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;human&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;formatInTimeZone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;utcIso&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;timeZone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;EEE, yyyy-MM-dd HH:mm:ss zzz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;timeZone&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;human&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you also need offset visibility (great for debugging), include &lt;code&gt;XXX&lt;/code&gt; in the format string: 🛠️&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;formatInTimeZone&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date-fns-tz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;utcIso&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2026-02-11T03:00:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;formatInTimeZone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;utcIso&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Australia/Melbourne&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;yyyy-MM-dd HH:mm:ss XXX (zzz)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Example shape: 2026-02-11 14:00:00 +11:00 (AEDT)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🗺️ IANA timezone names vs abbreviations
&lt;/h3&gt;

&lt;p&gt;Use IANA zone IDs (for example, &lt;code&gt;Australia/Sydney&lt;/code&gt;, &lt;code&gt;America/Toronto&lt;/code&gt;, &lt;code&gt;Europe/Amsterdam&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Avoid abbreviations as input (&lt;code&gt;AEST&lt;/code&gt;, &lt;code&gt;EST&lt;/code&gt;, &lt;code&gt;CST&lt;/code&gt;) because they are ambiguous globally and can map to different regions or DST states. ⚠️&lt;/p&gt;

&lt;p&gt;If your product has city-based use cases, let users choose city/region then map to an IANA zone internally.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✍️ Converting “local time in a city” → UTC (when users enter times)
&lt;/h2&gt;

&lt;p&gt;This is where scheduling systems fail most often. 📅&lt;/p&gt;

&lt;p&gt;Suppose a user picks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;local date/time: &lt;code&gt;2026-10-04 02:30&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;timezone: &lt;code&gt;Australia/Sydney&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You need to resolve that intended local wall-clock time to a UTC instant.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;fromZonedTime&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;date-fns-tz&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;localDateTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2026-10-04 02:30:00&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;timeZone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Australia/Sydney&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Interpret local wall-clock in the provided zone, then convert to a UTC Date&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;utcDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fromZonedTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localDateTime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;timeZone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;utcDate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toISOString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In browsers or Node services, this pattern is usually enough when combined with validation and user confirmation.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚠️ DST ambiguity you must handle
&lt;/h3&gt;

&lt;p&gt;During DST changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spring forward&lt;/strong&gt;: some local times do not exist (skipped hour).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fall back&lt;/strong&gt;: some local times occur twice (repeated hour).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A pragmatic production approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Capture local time + IANA timezone.&lt;/li&gt;
&lt;li&gt;Resolve to UTC server-side.&lt;/li&gt;
&lt;li&gt;Re-render and show the interpreted result to the user.&lt;/li&gt;
&lt;li&gt;Ask for explicit confirmation when time falls near DST boundaries.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This avoids silent “we guessed wrong” behavior. 👍&lt;/p&gt;

&lt;h2&gt;
  
  
  🧪 The DST traps you should explicitly test
&lt;/h2&gt;

&lt;p&gt;If timezone logic matters in your app, include these test scenarios: 🧪&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DST start (skipped hour)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DST end (repeated hour)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cross-date conversions (UTC date differs from local date)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two quick gotchas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Skipped hour example&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A user selects a local time that never occurs on DST start day. If your code auto-corrects without a warning, you might schedule at the wrong moment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-date example&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;2026-02-11T00:30:00Z&lt;/code&gt; may already be later local date in Asia-Pacific, while still prior date in North America. If you group analytics by “day” without zone-aware logic, reports drift.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you need a baseline conversion walkthrough first, see &lt;a href="https://www.pastetime.com/blog/how-to-convert-utc" rel="noopener noreferrer"&gt;How to Convert UTC&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌍 Examples by city (link hub — must include the internal links listed above)
&lt;/h2&gt;

&lt;p&gt;Use these city pages when you need quick validation, support replies, release planning, or runbook checks. 🌍&lt;/p&gt;

&lt;h3&gt;
  
  
  🇦🇺 Sydney
&lt;/h3&gt;

&lt;p&gt;Sydney is typically on Australian Eastern time with DST in part of the year, so the UTC offset changes seasonally. That's exactly why fixed-offset math fails across months.&lt;/p&gt;

&lt;p&gt;Use &lt;a href="https://www.pastetime.com/utc-to/sydney" rel="noopener noreferrer"&gt;UTC to Sydney time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏟️ Melbourne
&lt;/h3&gt;

&lt;p&gt;Melbourne follows a similar seasonal DST pattern to Sydney, so offset changes across the year are expected and normal.&lt;/p&gt;

&lt;p&gt;Use &lt;a href="https://www.pastetime.com/utc-to/melbourne" rel="noopener noreferrer"&gt;UTC to Melbourne time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🇸🇬 Singapore
&lt;/h3&gt;

&lt;p&gt;Singapore is generally stable year-round (no DST transitions in modern usage), which makes it simpler operationally—but you should still use timezone-aware formatting for consistency.&lt;/p&gt;

&lt;p&gt;Use &lt;a href="https://www.pastetime.com/utc-to/singapore" rel="noopener noreferrer"&gt;UTC to Singapore time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🇬🇧 London
&lt;/h3&gt;

&lt;p&gt;London switches between standard time and daylight time during the year, so offset shifts are frequent sources of scheduling confusion in global teams.&lt;/p&gt;

&lt;p&gt;Use &lt;a href="https://www.pastetime.com/utc-to/london" rel="noopener noreferrer"&gt;UTC to London time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🇦🇪 Dubai
&lt;/h3&gt;

&lt;p&gt;Dubai is generally a non-DST zone in modern practice, making offsets steady through the year.&lt;/p&gt;

&lt;p&gt;Use &lt;a href="https://www.pastetime.com/utc-to/dubai" rel="noopener noreferrer"&gt;UTC to Dubai time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🇨🇦 Toronto
&lt;/h3&gt;

&lt;p&gt;Toronto observes DST, so its UTC offset changes seasonally. This often affects recurring meetings and cron-like local schedules.&lt;/p&gt;

&lt;p&gt;Use &lt;a href="https://www.pastetime.com/utc-to/toronto" rel="noopener noreferrer"&gt;UTC to Toronto time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔁 Time difference quick links
&lt;/h3&gt;

&lt;p&gt;When you need side-by-side offset context instead of one-way conversion, use compare pages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.pastetime.com/compare/utc-vs/sydney" rel="noopener noreferrer"&gt;UTC vs Sydney&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pastetime.com/compare/utc-vs/amsterdam" rel="noopener noreferrer"&gt;UTC vs Amsterdam&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📋 A small checklist you can paste into PR reviews
&lt;/h2&gt;

&lt;p&gt;Use this in code review comments whenever timezone logic appears:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Keep one source of truth: store timestamps in UTC and store IANA timezone when user local intent matters.&lt;/li&gt;
&lt;li&gt;[ ] Add boundary coverage: explicitly test DST transition edges before merging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ❓ FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧭 Is UTC the same as GMT?
&lt;/h3&gt;

&lt;p&gt;They're close for everyday use, but not identical in standards context. For software engineering, UTC is the safer canonical reference. See &lt;a href="https://www.pastetime.com/blog/utc-vs-gmt" rel="noopener noreferrer"&gt;UTC vs GMT&lt;/a&gt;. 🧭&lt;/p&gt;

&lt;h3&gt;
  
  
  📆 Why do my conversions change during the year?
&lt;/h3&gt;

&lt;p&gt;Because many regions shift offsets during DST periods. Your UTC instant is stable; the local representation changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔢 Should I store timestamps as strings or numbers?
&lt;/h3&gt;

&lt;p&gt;Either can work. ISO strings are human-readable and API-friendly; epoch numbers are compact and fast for arithmetic. The key is consistency and explicit UTC semantics.&lt;/p&gt;

&lt;h3&gt;
  
  
  👤 What time zone should I store for users?
&lt;/h3&gt;

&lt;p&gt;Store the user's chosen IANA timezone (for example, &lt;code&gt;America/Toronto&lt;/code&gt;) as profile context, and store event instants in UTC.&lt;/p&gt;

&lt;h3&gt;
  
  
  🚦 How do I convert UTC to Sydney/Melbourne/Singapore/London time?
&lt;/h3&gt;

&lt;p&gt;Programmatically, use &lt;code&gt;formatInTimeZone(utcValue, ianaZone, pattern)&lt;/code&gt;. For quick checks, use &lt;a href="https://www.pastetime.com/utc-to/sydney" rel="noopener noreferrer"&gt;UTC to Sydney time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/melbourne" rel="noopener noreferrer"&gt;UTC to Melbourne time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/singapore" rel="noopener noreferrer"&gt;UTC to Singapore time&lt;/a&gt;, and &lt;a href="https://www.pastetime.com/utc-to/london" rel="noopener noreferrer"&gt;UTC to London time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤝 What's the safest way to schedule meetings across time zones?
&lt;/h3&gt;

&lt;p&gt;Capture organizer local time + timezone, resolve to UTC, store UTC, then render per attendee timezone. Always validate and confirm around DST boundaries.&lt;/p&gt;

&lt;h3&gt;
  
  
  ➗ Can I just save a UTC offset like +10:00?
&lt;/h3&gt;

&lt;p&gt;Not for recurring or future scheduling. Offsets alone don't encode DST rules. Store IANA timezone IDs.&lt;/p&gt;

&lt;h3&gt;
  
  
  🧰 Is &lt;code&gt;Date&lt;/code&gt; enough, or do I still need timezone libraries?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Date&lt;/code&gt; handles instants, but robust city-based formatting/parsing is safer with timezone-aware tools like &lt;code&gt;date-fns-tz&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Conclusion + “Try it” CTA
&lt;/h2&gt;

&lt;p&gt;Reliable timezone handling isn't about memorizing offsets—it's about using the right data model and conversion boundaries. 🚀&lt;/p&gt;

&lt;p&gt;If you remember one line, remember this: &lt;strong&gt;store UTC, carry timezone context, convert at the edges&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Try your own scenarios with Pastetime city converters, compare pages, and foundational guides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;City converters: &lt;a href="https://www.pastetime.com/utc-to/sydney" rel="noopener noreferrer"&gt;UTC to Sydney time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/melbourne" rel="noopener noreferrer"&gt;UTC to Melbourne time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/singapore" rel="noopener noreferrer"&gt;UTC to Singapore time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/london" rel="noopener noreferrer"&gt;UTC to London time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/dubai" rel="noopener noreferrer"&gt;UTC to Dubai time&lt;/a&gt;, &lt;a href="https://www.pastetime.com/utc-to/toronto" rel="noopener noreferrer"&gt;UTC to Toronto time&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Compare pages: &lt;a href="https://www.pastetime.com/compare/utc-vs/sydney" rel="noopener noreferrer"&gt;UTC vs Sydney&lt;/a&gt;, &lt;a href="https://www.pastetime.com/compare/utc-vs/amsterdam" rel="noopener noreferrer"&gt;UTC vs Amsterdam&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Explainer: &lt;a href="https://www.pastetime.com/blog/utc-vs-gmt" rel="noopener noreferrer"&gt;UTC vs GMT&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want a broader implementation playbook, continue with &lt;a href="https://www.pastetime.com/blog/best-practices-timezone-handling-apis" rel="noopener noreferrer"&gt;Best Practices for Timezone Handling in APIs&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>date</category>
      <category>timezone</category>
      <category>utc</category>
    </item>
    <item>
      <title>UTC vs GMT: What's the Difference and Which Should You Use?</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Thu, 02 Oct 2025 02:41:26 +0000</pubDate>
      <link>https://forem.com/luke_bowers/utc-vs-gmt-whats-the-difference-and-which-should-you-use-5g4f</link>
      <guid>https://forem.com/luke_bowers/utc-vs-gmt-whats-the-difference-and-which-should-you-use-5g4f</guid>
      <description>&lt;p&gt;When it comes to time zones, two acronyms always seem to pop up: &lt;strong&gt;UTC&lt;/strong&gt; and &lt;strong&gt;GMT&lt;/strong&gt;. At first glance they look interchangeable, and in most everyday situations they are. But if you're scheduling across time zones, writing software, or just curious about how the world keeps time, it's worth knowing the subtle differences.&lt;/p&gt;

&lt;p&gt;Let's break it down.&lt;/p&gt;




&lt;h2&gt;
  
  
  🕒 What is UTC?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;UTC stands for Coordinated Universal Time.&lt;/strong&gt;&lt;br&gt;
It's the modern standard for timekeeping, based on &lt;strong&gt;highly precise atomic clocks&lt;/strong&gt;. UTC doesn't change with the seasons and is designed to be the baseline reference for the entire world.&lt;/p&gt;

&lt;p&gt;Because of its accuracy, UTC is what computers, APIs, and most international systems rely on. When you see &lt;a href="https://www.pastetime.com/blog/understanding-timestamps/" rel="noopener noreferrer"&gt;timestamps&lt;/a&gt; in logs, databases, or global services, chances are they're stored in UTC.&lt;/p&gt;

&lt;p&gt;👉 Need to see UTC in your own time zone? &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;Use our UTC converter&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌍 What is GMT?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GMT stands for Greenwich Mean Time.&lt;/strong&gt;&lt;br&gt;
It originates from the &lt;strong&gt;Royal Observatory in Greenwich, London&lt;/strong&gt;, where "mean solar time" was measured from the Prime Meridian (longitude 0°).&lt;/p&gt;

&lt;p&gt;GMT has a long history. It was once the world's time standard and is still widely understood by the public. In practice, &lt;strong&gt;UK civil time&lt;/strong&gt; in winter is GMT, and industries like aviation and broadcasting sometimes use it interchangeably with UTC.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔑 Key Differences Between UTC and GMT
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Origin:&lt;/strong&gt; UTC is based on atomic clocks; GMT is based on the Earth's rotation and the position of the sun.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adjustments:&lt;/strong&gt; UTC occasionally adds a "leap second" to keep atomic time in sync with Earth's rotation; GMT doesn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; UTC is the standard in computing and science. GMT persists in everyday language and in specific industries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short: &lt;strong&gt;UTC is the technical standard, GMT is the historical label.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧭 Which Should You Use?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If you're a developer or working with systems:&lt;/strong&gt; Always use UTC. It's precise, consistent, and globally accepted in software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you're talking casually about time zones (especially in the UK):&lt;/strong&gt; GMT is fine — people understand it immediately.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pro tip: When dealing with time across regions, use UTC as your anchor and convert to local time for display. That way, nobody's meetings land at 3 a.m. by mistake. Learn more about &lt;a href="https://www.pastetime.com/blog/best-practices-timezone-handling-apis/" rel="noopener noreferrer"&gt;best practices for timezone handling in APIs&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ❌ Common Misconceptions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;"UTC and GMT are the same."&lt;/strong&gt;&lt;br&gt;
Not quite — they align most of the time, but UTC is the official modern standard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;"GMT observes daylight saving."&lt;/strong&gt;&lt;br&gt;
Incorrect. GMT itself does not change. The UK switches to &lt;em&gt;BST (British Summer Time)&lt;/em&gt; in summer, which is &lt;strong&gt;UTC+1&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧮 Practical Example
&lt;/h2&gt;

&lt;p&gt;Say it's &lt;strong&gt;12:00 UTC&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;London (winter):&lt;/strong&gt; 12:00 GMT — no offset.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;London (summer):&lt;/strong&gt; 13:00 BST — one hour ahead.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;New York:&lt;/strong&gt; 07:00 EST (or 08:00 EDT in summer).&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Sydney:&lt;/strong&gt; 23:00 AEDT during summer months.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rather than memorising offsets, you can always &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;drop a timestamp into our converter&lt;/a&gt; and see the local equivalent instantly. Need to convert programmatically? Check out our guide on &lt;a href="https://www.pastetime.com/blog/how-to-convert-utc/" rel="noopener noreferrer"&gt;how to convert UTC to your local time&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ❓ FAQs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is UTC ahead of GMT?&lt;/strong&gt;&lt;br&gt;
No. UTC and GMT are usually aligned to the same time, though UTC is the official reference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does aviation use GMT?&lt;/strong&gt;&lt;br&gt;
Tradition. Aviation and navigation historically used GMT, but in practice "GMT" means UTC in that context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does GMT change with daylight saving?&lt;/strong&gt;&lt;br&gt;
GMT itself doesn't. The UK switches to BST in summer, but GMT remains fixed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does software use UTC?&lt;/strong&gt;&lt;br&gt;
Because it never shifts with daylight saving and avoids messy calculations across regions.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;When you see UTC or GMT, you can think of them as close cousins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UTC&lt;/strong&gt; = precise, atomic, universal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GMT&lt;/strong&gt; = historical, familiar, sometimes still used in conversation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For everyday use, the difference may not matter. But for systems, software, and scheduling across borders, UTC is the standard you want.&lt;/p&gt;

&lt;p&gt;👉 Try it yourself: &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;convert UTC to your local time here&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Related Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📖 &lt;a href="https://www.pastetime.com/blog/how-to-convert-utc/" rel="noopener noreferrer"&gt;How to Convert UTC to Your Local Time&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📅 &lt;a href="https://www.pastetime.com/blog/understanding-timestamps/" rel="noopener noreferrer"&gt;Understanding Timestamps: ISO, Unix, and RFC Formats&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🛠️ &lt;a href="https://www.pastetime.com/blog/best-practices-timezone-handling-apis/" rel="noopener noreferrer"&gt;Best Practices for Timezone Handling in APIs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌎 &lt;a href="https://www.pastetime.com/guide/" rel="noopener noreferrer"&gt;Complete Guide to UTC Conversions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Need a quick timezone conversion? &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;Pastetime handles it&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding Timestamps: ISO, Unix, and RFC Formats</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Sun, 14 Sep 2025 05:50:17 +0000</pubDate>
      <link>https://forem.com/luke_bowers/understanding-timestamps-iso-unix-and-rfc-formats-3fa6</link>
      <guid>https://forem.com/luke_bowers/understanding-timestamps-iso-unix-and-rfc-formats-3fa6</guid>
      <description>&lt;p&gt;Timestamps show exactly when events happen. They're everywhere—from log files and APIs to database entries—but their multiple formats can confuse even experienced developers.&lt;/p&gt;

&lt;p&gt;In this guide, you'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The differences between ISO 8601, Unix, and RFC 2822 formats.&lt;/li&gt;
&lt;li&gt;When and why to use each format.&lt;/li&gt;
&lt;li&gt;How to convert timestamps easily using code examples.&lt;/li&gt;
&lt;li&gt;Best practices and common pitfalls.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⏰ What Exactly Is a Timestamp?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;timestamp&lt;/strong&gt; is simply data that records the exact time something occurred. In computing, we use them to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track data creation and modification.&lt;/li&gt;
&lt;li&gt;Synchronize events across systems.&lt;/li&gt;
&lt;li&gt;Debug by correlating system logs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📅 Common Timestamp Formats Explained
&lt;/h2&gt;

&lt;p&gt;There are three major formats used widely in software development:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;ISO 8601 Format&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;An international standard that's clear, sortable, and human-readable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2025-01-08T14:30:00Z
2025-01-08T14:30:00+00:00

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Human-readable and easy to sort.&lt;/li&gt;
&lt;li&gt;Clearly indicates timezones.&lt;/li&gt;
&lt;li&gt;Widely supported internationally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slightly verbose for massive datasets.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Unix Timestamp (Epoch Time)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Counts seconds (or milliseconds) from midnight, January 1, 1970 UTC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
1704720600 // Seconds
1704720600000 // Milliseconds

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compact and efficient.&lt;/li&gt;
&lt;li&gt;Easy for calculations and comparisons.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not easily readable without conversion.&lt;/li&gt;
&lt;li&gt;No direct timezone information.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;RFC 2822 Format&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Commonly used in email and HTTP headers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Wed, 08 Jan 2025 14:30:00 GMT
Wed, 08 Jan 2025 09:30:00 -0500

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Human-readable.&lt;/li&gt;
&lt;li&gt;Standard in email protocols.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not sortable as text.&lt;/li&gt;
&lt;li&gt;Locale-dependent (month names).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🗂️ Quick Reference Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;ISO 8601&lt;/th&gt;
&lt;th&gt;Unix Timestamp&lt;/th&gt;
&lt;th&gt;RFC 2822&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Human-readable&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compact storage&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sortable&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅ (numeric)&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timezone clarity&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Usage context&lt;/td&gt;
&lt;td&gt;APIs, logs&lt;/td&gt;
&lt;td&gt;Databases, apps&lt;/td&gt;
&lt;td&gt;Email, HTTP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🛠️ When to Use Each Format
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ISO 8601&lt;/strong&gt;: APIs, logs, international apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unix Timestamp&lt;/strong&gt;: Databases, performance-critical apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RFC 2822&lt;/strong&gt;: Emails, HTTP headers, legacy systems.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ How to Convert Between Formats
&lt;/h2&gt;

&lt;p&gt;Use the examples below to quickly convert timestamps in your applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  JavaScript
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ISO 8601 to Unix timestamp&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isoDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2025-01-08T14:30:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unixTimestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isoDate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Unix timestamp to ISO 8601&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1704720600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isoString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toISOString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// RFC 2822 to ISO 8601&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rfcDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Wed, 08 Jan 2025 14:30:00 GMT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isoFromRfc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rfcDate&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toISOString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;

&lt;span class="c1"&gt;# ISO 8601 to Unix timestamp
&lt;/span&gt;&lt;span class="n"&gt;iso_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2025-01-08T14:30:00Z&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;dt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromisoformat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iso_date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Z&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;+00:00&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;unix_timestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Unix timestamp to ISO 8601
&lt;/span&gt;&lt;span class="n"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1704720600&lt;/span&gt;
&lt;span class="n"&gt;iso_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromtimestamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tz&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# RFC 2822 to ISO 8601
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;email.utils&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;parsedate_to_datetime&lt;/span&gt;
&lt;span class="n"&gt;rfc_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Wed, 08 Jan 2025 14:30:00 GMT&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;iso_from_rfc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parsedate_to_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rfc_date&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Always store timestamps in UTC.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose a consistent format&lt;/strong&gt; for your app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use timezone-aware libraries&lt;/strong&gt; (&lt;code&gt;date-fns-tz&lt;/code&gt;, &lt;code&gt;Luxon&lt;/code&gt;, &lt;code&gt;pytz&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate input formats&lt;/strong&gt; to prevent errors.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚩 Avoid Common Pitfalls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Year 2038 problem&lt;/strong&gt;: Ensure your system uses 64-bit Unix timestamps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timezone confusion&lt;/strong&gt;: Never store timestamps without explicit timezone data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Daylight Saving Time&lt;/strong&gt;: Use UTC to avoid DST issues.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚡ Quick Timestamp Conversion Online
&lt;/h2&gt;

&lt;p&gt;If you need instant conversion, use our &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;free timestamp converter&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste any timestamp—we auto-detect formats.&lt;/li&gt;
&lt;li&gt;Get instant conversions between ISO, Unix, RFC, and your local timezone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;Try Pastetime now&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Related Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📖 &lt;a href="https://dev.to/blog/how-to-convert-utc/"&gt;How to Convert UTC to Your Local Time&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🛠️ &lt;a href="https://dev.to/blog/best-practices-timezone-handling-apis/"&gt;Best Practices for Timezone Handling in APIs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌎 &lt;a href="https://dev.to/guide/"&gt;Complete Guide to UTC Conversions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Need a quick timestamp conversion? &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;Pastetime handles it&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🕒 Embed Event Times on Your Blog (Free) — Meet the Pastetime Widget</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Tue, 12 Aug 2025 11:10:42 +0000</pubDate>
      <link>https://forem.com/luke_bowers/embed-event-times-on-your-blog-free-meet-the-pastetime-widget-58d7</link>
      <guid>https://forem.com/luke_bowers/embed-event-times-on-your-blog-free-meet-the-pastetime-widget-58d7</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Paste a single &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and your post will automatically show the event time in each visitor’s local timezone — with optional countdown and &lt;strong&gt;Add to Calendar&lt;/strong&gt;. No account needed. ✨ See the full &lt;a href="https://www.pastetime.com/widget-guide" rel="noopener noreferrer"&gt;Widget Guide&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this matters (especially for WordPress &amp;amp; solo bloggers) 💡
&lt;/h2&gt;

&lt;p&gt;“&lt;strong&gt;2pm EST&lt;/strong&gt;” = confusion; “&lt;strong&gt;2pm your time&lt;/strong&gt;” = clarity. The Pastetime widget detects a reader’s timezone and displays your event cleanly right inside your post — perfect for launches, livestreams, webinars, or meetups. Learn more in the &lt;a href="https://www.pastetime.com/widget-guide/" rel="noopener noreferrer"&gt;Widget Guide&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick start (copy–paste) ⚡
&lt;/h2&gt;

&lt;p&gt;Drop this where you mention your event (e.g., in the WordPress editor’s HTML view or a custom HTML block):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script
  &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.pastetime.com/embed/embed.js"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-time=&lt;/span&gt;&lt;span class="s"&gt;"2024-02-15T14:00:00Z"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-timezone=&lt;/span&gt;&lt;span class="s"&gt;"America/New_York"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-title=&lt;/span&gt;&lt;span class="s"&gt;"Product Launch"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it — the widget will detect the visitor’s timezone, convert your event time, and render a tidy card.&lt;/p&gt;




&lt;h2&gt;
  
  
  What your readers will see 👀
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your &lt;strong&gt;event time&lt;/strong&gt; (original timezone) + their &lt;strong&gt;local time&lt;/strong&gt; (auto-detected)&lt;/li&gt;
&lt;li&gt;Optional &lt;strong&gt;countdown&lt;/strong&gt; (“Starts in…”)&lt;/li&gt;
&lt;li&gt;One-click &lt;strong&gt;Add to Calendar&lt;/strong&gt; (major calendars supported)&lt;/li&gt;
&lt;li&gt;A small “Powered by Pastetime” attribution by default (you can hide it)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Copy-ready examples you can steal 🧩
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) Enhanced Event + Countdown ⏱️
&lt;/h3&gt;

&lt;p&gt;Shows title, location (e.g., Zoom link), duration, countdown, and local time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script
  &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.pastetime.com/embed/embed.js"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-time=&lt;/span&gt;&lt;span class="s"&gt;"2025-09-10T10:00:00Z"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-timezone=&lt;/span&gt;&lt;span class="s"&gt;"Europe/London"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-title=&lt;/span&gt;&lt;span class="s"&gt;"Global Conference"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-location=&lt;/span&gt;&lt;span class="s"&gt;"https://zoom.us/j/123456"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-duration=&lt;/span&gt;&lt;span class="s"&gt;"2"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-countdown=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-local-time=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-calendar=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;This mirrors the guide’s “Enhanced Event with Countdown” configuration.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  2) Light Theme (for bright pages) 🌤️
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script
  &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.pastetime.com/embed/embed.js"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-time=&lt;/span&gt;&lt;span class="s"&gt;"2025-10-20T16:00:00Z"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-timezone=&lt;/span&gt;&lt;span class="s"&gt;"Asia/Tokyo"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-title=&lt;/span&gt;&lt;span class="s"&gt;"Team Meeting"&lt;/span&gt;
  &lt;span class="na"&gt;data-theme=&lt;/span&gt;&lt;span class="s"&gt;"light"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-local-time=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-countdown=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-calendar=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Light theme is built-in and great on white backgrounds.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  3) Minimal footprint (hide branding/actions) 🧼
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script
  &lt;/span&gt;&lt;span class="na"&gt;async&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://www.pastetime.com/embed/embed.js"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-time=&lt;/span&gt;&lt;span class="s"&gt;"2025-11-01T09:00:00Z"&lt;/span&gt;
  &lt;span class="na"&gt;data-event-timezone=&lt;/span&gt;&lt;span class="s"&gt;"Australia/Sydney"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-brand=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;
  &lt;span class="na"&gt;data-show-calendar=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;The “Minimal Widget” keeps things tiny when space is tight.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Configuration at a glance 🧰
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Required&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data-event-time&lt;/code&gt; — ISO 8601, e.g. &lt;code&gt;2024-02-15T14:00:00Z&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-event-timezone&lt;/code&gt; — IANA zone, e.g. &lt;code&gt;Europe/London&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Optional (most popular)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data-event-title&lt;/code&gt; — widget header + calendar title&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-event-location&lt;/code&gt; — venue or meeting link (Zoom, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-event-duration&lt;/code&gt; — hours (default &lt;strong&gt;1&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-show-countdown&lt;/code&gt; — &lt;code&gt;"true"|"false"&lt;/code&gt; (default &lt;strong&gt;false&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-show-local-time&lt;/code&gt; — &lt;code&gt;"true"|"false"&lt;/code&gt; (default &lt;strong&gt;false&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-theme&lt;/code&gt; — &lt;code&gt;"light"|"dark"&lt;/code&gt; (default &lt;strong&gt;dark&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-show-brand&lt;/code&gt; — &lt;code&gt;"true"|"false"&lt;/code&gt; (default &lt;strong&gt;true&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-show-calendar&lt;/code&gt; — &lt;code&gt;"true"|"false"&lt;/code&gt; (default &lt;strong&gt;true&lt;/strong&gt;; hides actions if false &amp;amp; no location)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: If you skip &lt;code&gt;data-event-title&lt;/code&gt;, the header hides automatically; calendar downloads fall back to “Event.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Performance, compatibility &amp;amp; accessibility 🚀
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;~&lt;strong&gt;15 KB&lt;/strong&gt; minified JS; external CSS is cache-friendly&lt;/li&gt;
&lt;li&gt;Caches conversions in &lt;strong&gt;localStorage&lt;/strong&gt; for repeat visits&lt;/li&gt;
&lt;li&gt;Works on &lt;strong&gt;Chrome, Firefox, Safari, Edge&lt;/strong&gt;, plus mobile browsers; screen-reader friendly; cross-origin embeds are fine&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Error handling (in case things go sideways) 🛡️
&lt;/h2&gt;

&lt;p&gt;If timezone detection fails, the widget shows the original event time, explains what happened, and links to the &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;converter&lt;/a&gt;. If the &lt;a href="https://www.pastetime.com/api/docs" rel="noopener noreferrer"&gt;API&lt;/a&gt; fails, it keeps the layout intact, shows an error, and links to manual conversion.&lt;/p&gt;




&lt;h2&gt;
  
  
  Privacy (no creepy stuff) 🔒
&lt;/h2&gt;

&lt;p&gt;Pastetime uses &lt;strong&gt;Umami&lt;/strong&gt; and basic API endpoint tracking — &lt;strong&gt;no cookies, IP addresses, or personal identifiers&lt;/strong&gt;. See our &lt;a href="https://www.pastetime.com/privacy" rel="noopener noreferrer"&gt;privacy policy&lt;/a&gt; for details.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Related resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Widget Guide&lt;/strong&gt;: Setup, options, and styling — &lt;a href="https://www.pastetime.com/widget-guide" rel="noopener noreferrer"&gt;Widget Guide&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to Convert UTC&lt;/strong&gt;: Concepts and examples — &lt;a href="https://www.pastetime.com/blog/how-to-convert-utc" rel="noopener noreferrer"&gt;Convert UTC to Local Time&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timestamp Formats&lt;/strong&gt;: ISO, Unix, RFC — &lt;a href="https://www.pastetime.com/blog/understanding-timestamps" rel="noopener noreferrer"&gt;Understanding Timestamps&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Docs&lt;/strong&gt;: Conversion and helper endpoints — &lt;a href="https://www.pastetime.com/api/docs" rel="noopener noreferrer"&gt;Pastetime API&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt;: Data handling overview — &lt;a href="https://www.pastetime.com/privacy" rel="noopener noreferrer"&gt;Privacy Policy&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Where this shines for bloggers ✍️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Event announcement posts&lt;/strong&gt; — launch times, webinars, premieres&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weekly community updates&lt;/strong&gt; — kickoff times across regions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Course pages &amp;amp; office hours&lt;/strong&gt; — post one time; readers see theirs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Newsletter archives&lt;/strong&gt; — embeds survive copy-paste into your site&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  FAQ ❓
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does it handle daylight saving time?&lt;/strong&gt;&lt;br&gt;
Yes. The conversion respects each locale’s DST rules automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I set a default zone/time?&lt;/strong&gt;&lt;br&gt;
Yes — that’s your &lt;code&gt;data-event-time&lt;/code&gt; + &lt;code&gt;data-event-timezone&lt;/code&gt;. The widget converts to each reader’s local zone on load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will it work on WordPress or Notion?&lt;/strong&gt;&lt;br&gt;
Yep. It’s a plain script tag — great for Custom HTML blocks and most CMSes. (Cross-origin embedding is supported.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I hide the “Powered by Pastetime” link?&lt;/strong&gt;&lt;br&gt;
Sure — set &lt;code&gt;data-show-brand="false"&lt;/code&gt;. (Keeping it on helps support the free tier 💜.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it really free? Do I have to sign up?&lt;/strong&gt;&lt;br&gt;
Free to use, no registration required.&lt;/p&gt;




&lt;h2&gt;
  
  
  Ready to add it to your next post? 🚀
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;strong&gt;Get the widget:&lt;/strong&gt; see the full &lt;strong&gt;Widget Guide&lt;/strong&gt; with more examples — &lt;a href="https://www.pastetime.com/widget-guide" rel="noopener noreferrer"&gt;Widget Guide&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧪 &lt;strong&gt;Test it live:&lt;/strong&gt; drop the Quick Start snippet into a draft and preview&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Questions?&lt;/strong&gt; Ping us — we’re friendly and fast&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy embedding &amp;amp; happy publishing! 🎉&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tooling</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>🔧 10 Date-and-Time Bugs I Still See in Production (and How to Avoid Them)</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Mon, 28 Jul 2025 07:15:34 +0000</pubDate>
      <link>https://forem.com/luke_bowers/10-date-and-time-bugs-i-still-see-in-production-and-how-to-avoid-them-31ke</link>
      <guid>https://forem.com/luke_bowers/10-date-and-time-bugs-i-still-see-in-production-and-how-to-avoid-them-31ke</guid>
      <description>&lt;p&gt;After more than a decade writing backend code, I've fixed the same time-related bugs over and over.&lt;br&gt;&lt;br&gt;
Below are ten of the worst offenders, why they happen, and a proven way to avoid each one. I've linked free tools and API calls from &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;Pastetime&lt;/a&gt; so you can try the fixes right away.&lt;/p&gt;


&lt;h2&gt;
  
  
  🐞 Bug 1 – Storing Local Time in the Database
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What you see&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Reports jump an hour forward or back every spring and autumn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it happens&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Local timestamps are ambiguous when daylight‐saving rules shift or the server moves to a new zone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Store UTC only, convert on display.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick test&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Paste any local time into the &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;UTC-to converter&lt;/a&gt; to see the safe format.&lt;/p&gt;


&lt;h2&gt;
  
  
  🐞 Bug 2 – Mixing Unix Seconds and Milliseconds
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Symptom&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Graphs plot dates in the year 51345 or collapse to 1970.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Safe JS conversion&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unixMs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1754136000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// milliseconds&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;unixMs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// correct&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unixS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;unixMs&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need a spot-check?&lt;br&gt;
&lt;code&gt;POST /api/convert-timestamp&lt;/code&gt; in the &lt;a href="https://www.pastetime.com/api/docs" rel="noopener noreferrer"&gt;API docs&lt;/a&gt; returns both seconds and milliseconds.&lt;/p&gt;


&lt;h2&gt;
  
  
  🐞 Bug 3 – Hard-coding Weekends
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;br&gt;
Business-day counts are wrong where the weekend is Friday–Saturday.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://www.pastetime.com/api/business-days"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
        "startDate": "2025-07-01",
        "endDate":   "2025-07-10",
        "weekendDays": ["Friday","Saturday"]
      }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or use the UI at &lt;a href="https://www.pastetime.com/business-days-calculator" rel="noopener noreferrer"&gt;/business-days-calculator&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 4 – Ignoring DST in Cron Jobs
&lt;/h2&gt;

&lt;p&gt;Jobs drift by an hour when daylight-saving hits.&lt;br&gt;
&lt;strong&gt;Fix&lt;/strong&gt;: run cron in UTC or use a scheduler that's zone-aware.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 5 – DIY Natural-Language Parsing
&lt;/h2&gt;

&lt;p&gt;Regex can't parse "next Friday 3 pm Berlin."&lt;br&gt;
&lt;code&gt;POST /api/convert&lt;/code&gt; handles it and returns ISO, Unix, and human text.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 6 – Silent JavaScript Date Coercion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;new Date('2025-07-02')&lt;/code&gt; can flip to the previous day in some browsers.&lt;br&gt;
Always include the timezone offset or use a library like &lt;code&gt;date-fns-tz&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 7 – Hard-coded Holiday Lists
&lt;/h2&gt;

&lt;p&gt;Holiday arrays go stale.&lt;br&gt;
Pass holidays at runtime via the Business Days API, or store them centrally.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 8 – Leap Year (and Leap Second) Edge Cases
&lt;/h2&gt;

&lt;p&gt;Date math fails on Feb 29 or during leap seconds.&lt;br&gt;
Trust a tested library or API instead of hand-rolled arithmetic.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 9 – Server Timezone Drift
&lt;/h2&gt;

&lt;p&gt;Containers boot in UTC, code expects local.&lt;br&gt;
Pin the &lt;code&gt;TZ&lt;/code&gt; env var or convert to UTC everywhere.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐞 Bug 10 – Sorting Raw Date Strings
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;2025-07-2&lt;/code&gt; sorts before &lt;code&gt;2025-07-12&lt;/code&gt;.&lt;br&gt;
Use padded ISO (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;) or Unix timestamps, not loose strings.&lt;/p&gt;




&lt;h2&gt;
  
  
  📋 Cheat Sheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bug&lt;/th&gt;
&lt;th&gt;Fast Fix&lt;/th&gt;
&lt;th&gt;Tool / API&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Local time in DB&lt;/td&gt;
&lt;td&gt;Store UTC only&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;/utc-to&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Seconds vs ms&lt;/td&gt;
&lt;td&gt;Standardise or convert&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/convert-timestamp&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard-coded weekends&lt;/td&gt;
&lt;td&gt;Pass config&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/business-days&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DST cron drift&lt;/td&gt;
&lt;td&gt;Run in UTC&lt;/td&gt;
&lt;td&gt;Upcoming cron guide&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DIY NLP parsing&lt;/td&gt;
&lt;td&gt;Use API&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/convert&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JS coercion&lt;/td&gt;
&lt;td&gt;Include TZ offset&lt;/td&gt;
&lt;td&gt;&lt;a href="https://www.pastetime.com/guide" rel="noopener noreferrer"&gt;Timestamp guide&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🚀 Wrap-Up
&lt;/h2&gt;

&lt;p&gt;Date bugs rarely crash apps, yet they quietly break schedules and revenue. Use the Pastetime web tools for quick fixes or call the API when you need reliable automation.&lt;/p&gt;

&lt;p&gt;Have a horror story or feature request?&lt;br&gt;
&lt;a href="https://github.com/luke-bowers/pastetime/issues/new?template=feature_request.yml" rel="noopener noreferrer"&gt;Open an issue&lt;/a&gt; or ping me on &lt;a href="https://twitter.com/_lbowers" rel="noopener noreferrer"&gt;X&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Support the project on &lt;a href="https://ko-fi.com/lukebowers" rel="noopener noreferrer"&gt;Ko-fi&lt;/a&gt; or &lt;a href="https://coff.ee/lukebowers" rel="noopener noreferrer"&gt;Buy Me a Coffee&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Convert UTC to Local Time - Guide &amp; Examples</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Thu, 17 Jul 2025 07:40:05 +0000</pubDate>
      <link>https://forem.com/luke_bowers/convert-utc-to-local-time-guide-examples-48b</link>
      <guid>https://forem.com/luke_bowers/convert-utc-to-local-time-guide-examples-48b</guid>
      <description>&lt;h1&gt;
  
  
  How to Convert UTC to Your Local Time (with Examples &amp;amp; Tools)
&lt;/h1&gt;

&lt;p&gt;Struggling with timestamps like &lt;code&gt;2025-07-02T12:00:00Z&lt;/code&gt; and wondering how they translate to your local timezone? You're in the right place.&lt;/p&gt;

&lt;p&gt;Whether you're debugging, reading logs, or using APIs, converting &lt;strong&gt;UTC (Coordinated Universal Time)&lt;/strong&gt; timestamps to local time is a common and crucial task for developers and analysts.&lt;/p&gt;

&lt;p&gt;In this guide, you'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why&lt;/strong&gt; UTC is important in computing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to convert&lt;/strong&gt; UTC to your local timezone quickly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt; using our &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;online UTC converter&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code snippets&lt;/strong&gt; in JavaScript and Python.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best practices&lt;/strong&gt; and common pitfalls when dealing with UTC and timezones.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🕑 What Is a UTC Timestamp?
&lt;/h2&gt;

&lt;p&gt;A UTC timestamp is a standardized representation of date and time used globally. It's timezone-neutral, meaning it doesn't change with location or daylight saving. You'll commonly see formats like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2025-07-02T12:00:00Z

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Z&lt;/code&gt; represents "Zulu" or zero timezone offset (UTC+0).&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 Why Use UTC in Your Applications?
&lt;/h2&gt;

&lt;p&gt;Storing and using UTC timestamps offers these benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Consistency&lt;/strong&gt;: No daylight-saving confusion.&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;Global compatibility&lt;/strong&gt;: Recognized universally.&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;Database-friendly&lt;/strong&gt;: Easier indexing and querying.&lt;/li&gt;
&lt;li&gt;📡 &lt;strong&gt;Standard for APIs&lt;/strong&gt;: Most APIs return timestamps in UTC by default.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📅 Common UTC Timestamp Formats
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ISO 8601
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2025-01-08T14:30:00Z
2025-01-08T14:30:00.123Z

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Unix Timestamp (Epoch)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
1704720600

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  RFC 2822
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Wed, 08 Jan 2025 14:30:00 GMT

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚡ Convert UTC to Local Time Instantly
&lt;/h2&gt;

&lt;p&gt;To quickly convert timestamps without coding, use our &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;free online UTC converter&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Paste your timestamp&lt;/strong&gt; in ISO, Unix, or RFC format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-detect or select your timezone&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instantly see local results&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;2025-01-08T14:30:00Z&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output (New York):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local: January 8, 2025, 9:30 AM EST&lt;/li&gt;
&lt;li&gt;Unix: 1704720600&lt;/li&gt;
&lt;li&gt;RFC: Wed, 08 Jan 2025 09:30:00 -0500&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;Try the converter now&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 Convert UTC Programmatically
&lt;/h2&gt;

&lt;p&gt;Here's how you can easily handle timezone conversions in code.&lt;/p&gt;

&lt;h3&gt;
  
  
  JavaScript Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Convert ISO 8601 UTC to local time&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;utcDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2025-01-08T14:30:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;localTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;utcDate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localTime&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Convert Unix timestamp to local time&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unixTimestamp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1704720600&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;localUnix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;unixTimestamp&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localUnix&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Python Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pytz&lt;/span&gt;

&lt;span class="c1"&gt;# Convert ISO 8601 UTC to local timezone
&lt;/span&gt;&lt;span class="n"&gt;utc_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromisoformat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2025-01-08T14:30:00+00:00&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;local_tz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pytz&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;America/New_York&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;local_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utc_time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;astimezone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;local_tz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;local_time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Best Practices for Handling UTC &amp;amp; Timezones
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Always store timestamps in UTC&lt;/strong&gt; for consistent data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Convert to local only for display&lt;/strong&gt;, never for storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use reliable timezone libraries&lt;/strong&gt; (&lt;code&gt;date-fns-tz&lt;/code&gt;, &lt;code&gt;Luxon&lt;/code&gt;, &lt;code&gt;pytz&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid manual timezone offset calculations&lt;/strong&gt; (DST makes this tricky).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚨 Common UTC Conversion Issues &amp;amp; Fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The mysterious "Z"
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;"Z"&lt;/code&gt; stands for Zulu Time (UTC+0). It's equivalent to &lt;code&gt;+00:00&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Unix timestamps confusion
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Unix timestamps count seconds from &lt;code&gt;1970-01-01&lt;/code&gt; UTC.&lt;/li&gt;
&lt;li&gt;Multiply by 1000 for milliseconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Daylight Saving Time (DST)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;DST shifts local time—use libraries that handle this automatically (or our &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;converter&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 Quick Recap: Converting UTC to Local Time
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Paste your timestamp into &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;Pastetime.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Get automatic, reliable local conversions.&lt;/li&gt;
&lt;li&gt;Copy or use our provided JS/Python snippets for coding tasks.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  📚 Related Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📖 &lt;a href="https://dev.to/blog/understanding-timestamps/"&gt;Understanding Timestamps: ISO, Unix, and RFC Formats&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🛠️ &lt;a href="https://dev.to/blog/best-practices-timezone-handling-apis/"&gt;Best Practices for Timezone Handling in APIs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌎 &lt;a href="https://dev.to/guide/"&gt;Complete Guide to UTC Conversions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Need further help? &lt;a href="https://www.pastetime.com" rel="noopener noreferrer"&gt;Try our live converter&lt;/a&gt; or contact us—we're here to simplify timezone conversions.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tooling</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Working with timezones and timestamps can be a pain - read on to make it pain free</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Wed, 16 Jul 2025 23:50:41 +0000</pubDate>
      <link>https://forem.com/luke_bowers/-4lc7</link>
      <guid>https://forem.com/luke_bowers/-4lc7</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/luke_bowers" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1835366%2F9350ee72-e314-4166-bcbc-fe9f52993b29.jpg" alt="luke_bowers"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/luke_bowers/the-hidden-hassle-of-time-37kf" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Stop Struggling With Timezones: Free Tools and Real-World Tips for Developers&lt;/h2&gt;
      &lt;h3&gt;Luke Bowers ・ Jul 14&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#showdev&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>productivity</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Stop Struggling With Timezones: Free Tools and Real-World Tips for Developers</title>
      <dc:creator>Luke Bowers</dc:creator>
      <pubDate>Mon, 14 Jul 2025 23:11:54 +0000</pubDate>
      <link>https://forem.com/luke_bowers/the-hidden-hassle-of-time-37kf</link>
      <guid>https://forem.com/luke_bowers/the-hidden-hassle-of-time-37kf</guid>
      <description>&lt;p&gt;Have you ever spent hours wrestling with date math or trying to figure out why a meeting time, deadline, or log entry just didn’t add up? I kept running into this pain, so I built &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;Pastetime.com/&lt;/a&gt; as the set of tools I wish I’d had all along.&lt;/p&gt;

&lt;p&gt;If you’ve ever wondered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many business days are between two dates (including weird weekends and local holidays)&lt;/li&gt;
&lt;li&gt;How to convert between UTC and your local time (or another city)&lt;/li&gt;
&lt;li&gt;How to quickly translate between ISO, Unix, and RFC 2822 timestamps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’re in the right place.&lt;br&gt;&lt;br&gt;
Let me show you how I made date and time math painless (and how you can too).&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Free Tools I Built at Pastetime.com/
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🗓️ Business Days Calculator
&lt;/h3&gt;

&lt;p&gt;Enter two dates, pick your weekend days, and add any holidays—get an instant answer. No more spreadsheet formulas or mistakes on deadlines.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://www.pastetime.com/business-days-calculator/" rel="noopener noreferrer"&gt;Try the Business Days Calculator&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🌐 UTC to Local Time Converter
&lt;/h3&gt;

&lt;p&gt;Paste in any timestamp (ISO, Unix, or RFC 2822), and see what time that actually is for you, or any city you need. Perfect for debugging logs, API calls, or planning global meetings.&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://www.pastetime.com/" rel="noopener noreferrer"&gt;Try the UTC Converter&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 For Developers: Real Code, Real Problems
&lt;/h2&gt;

&lt;p&gt;I’m a dev myself, so I know most of us want to see how stuff works. I’ve written a few detailed blog posts that walk through the logic, show you code snippets in JavaScript and Python, and share lessons learned from real-world headaches.&lt;/p&gt;

&lt;p&gt;Check them out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📆 &lt;a href="https://www.pastetime.com/blog/how-to-calculate-business-days/" rel="noopener noreferrer"&gt;How to Calculate Business Days Between Two Dates&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🕒 &lt;a href="https://www.pastetime.com/blog/how-to-convert-utc/" rel="noopener noreferrer"&gt;How to Convert UTC to Your Local Time&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🏷️ &lt;a href="https://www.pastetime.com/blog/understanding-timestamps/" rel="noopener noreferrer"&gt;Understanding Timestamps: ISO, Unix, and RFC Formats&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 Why I Built This
&lt;/h2&gt;

&lt;p&gt;I was tired of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remembering which days count as weekends in different countries&lt;/li&gt;
&lt;li&gt;Getting tripped up by daylight saving time&lt;/li&gt;
&lt;li&gt;Hardcoding holiday lists (and still missing a local one)&lt;/li&gt;
&lt;li&gt;Struggling to convert timestamps in logs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I put it all in one place. No logins, no ads, just fast, focused tools.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Let’s Learn Together
&lt;/h2&gt;

&lt;p&gt;If you have a weird time zone story, a nasty bug you finally squashed, or a request for another tool, I’d love to hear it!&lt;br&gt;&lt;br&gt;
What’s your biggest date/time pain point? Drop a comment below or message me—maybe it’ll inspire the next feature or blog post.&lt;/p&gt;

&lt;p&gt;🙌 If you found this helpful, a comment or share would mean a lot. Maybe together we can make time math a little less painful.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
