<?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>DEV Community: Karthik Parameshwara</title>
    <description>The latest articles on DEV Community by Karthik Parameshwara (@k4rthik_).</description>
    <link>https://dev.to/k4rthik_</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4217290%2F9b75c866-e1d3-4007-afb8-b9cde30fd826.jpg</url>
      <title>DEV Community: Karthik Parameshwara</title>
      <link>https://dev.to/k4rthik_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/k4rthik_"/>
    <language>en</language>
    <item>
      <title>Making a personal website readable by AI agents: Markdown pages, llms.txt and an MCP server</title>
      <dc:creator>Karthik Parameshwara</dc:creator>
      <pubDate>Thu, 19 Nov 2026 12:50:21 +0000</pubDate>
      <link>https://dev.to/k4rthik_/making-a-personal-website-readable-by-ai-agents-markdown-pages-llmstxt-and-an-mcp-server-2akl</link>
      <guid>https://dev.to/k4rthik_/making-a-personal-website-readable-by-ai-agents-markdown-pages-llmstxt-and-an-mcp-server-2akl</guid>
      <description>&lt;p&gt;Recruiters and engineers increasingly work through AI assistants. I wanted karthik.nz to give those assistants clean, approved text instead of 60 to 148 KB of HTML per page. This post covers what I added and the decisions behind each piece. The site is Next.js on Vercel, and the changes were made without altering what human visitors see.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. One registry, Markdown for every page
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;src/lib/agent-docs.ts&lt;/code&gt; lists every page (home, resume, open source, each case study) with a title, a one-line summary and a Markdown builder. Everything below reads from that single registry.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every page has a Markdown twin: &lt;code&gt;/index.md&lt;/code&gt;, &lt;code&gt;/resume.md&lt;/code&gt;, &lt;code&gt;/open-source.md&lt;/code&gt;, &lt;code&gt;/work/&amp;lt;slug&amp;gt;.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/llms.txt&lt;/code&gt; is an index of those pages, and &lt;code&gt;/llms-full.txt&lt;/code&gt; is everything in one file.&lt;/li&gt;
&lt;li&gt;A request with &lt;code&gt;Accept: text/markdown&lt;/code&gt; gets the Markdown. Browsers never send that header, so they keep getting HTML.&lt;/li&gt;
&lt;li&gt;Markdown responses carry &lt;code&gt;Link: &amp;lt;page URL&amp;gt;; rel="canonical"&lt;/code&gt;, so search engines index the HTML page and not its copy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I considered converting the built HTML with a package, or hand-writing Markdown files. I chose to generate Markdown from the same content the pages render. A converter repeats navigation text and adds a dependency, and hand-written files drift out of date. With one source, the output can be checked.&lt;/p&gt;

&lt;p&gt;That check is a script (&lt;code&gt;agent-docs:check&lt;/code&gt;) run against a production build. It fails if the Markdown says anything the page does not. The Markdown comes to 2 to 7 KB per page, so an agent can read a whole page cheaply.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Telling agents the Markdown exists
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Each HTML page sends a &lt;code&gt;Link: &amp;lt;.../resume.md&amp;gt;; rel="alternate"; type="text/markdown"&lt;/code&gt; header. A header adds no bytes to the page and no work in the browser.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;curl&lt;/code&gt; card on the site gained one row pointing at &lt;code&gt;/llms.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;IndexNow (a free protocol with a public key and no account) tells Bing about changed pages. Bing's index feeds ChatGPT search and Copilot. It runs by hand after a deploy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. A read-only MCP server
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;https://karthik.nz/mcp&lt;/code&gt; is a Streamable HTTP MCP server with no sign-in. It exposes five tools (&lt;code&gt;get_profile&lt;/code&gt;, &lt;code&gt;get_resume&lt;/code&gt;, &lt;code&gt;list_projects&lt;/code&gt;, &lt;code&gt;get_project&lt;/code&gt;, &lt;code&gt;get_open_source&lt;/code&gt;) and one resource per page.&lt;/p&gt;

&lt;p&gt;I used the official TypeScript SDK on its own, inside a Next.js route handler. Its transport takes a &lt;code&gt;Request&lt;/code&gt; and returns a &lt;code&gt;Response&lt;/code&gt;, which is exactly what a route handler is. Vercel's adapter would have added a package for nothing, and hand-written JSON-RPC would have missed protocol details the SDK handles. The server is stateless, with a fresh instance per request.&lt;/p&gt;

&lt;p&gt;Because answers come from the same registry as the pages, the server cannot say anything the website does not. &lt;code&gt;mcp:check&lt;/code&gt; connects with the SDK's own client, calls every tool, reads every resource and compares each answer to the matching Markdown page.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Listing it in the MCP Registry
&lt;/h2&gt;

&lt;p&gt;The official registry requires a name in a namespace you can prove you own. I used &lt;code&gt;nz.karthik/karthik-parameshwara&lt;/code&gt;, proven by a public key at &lt;code&gt;/.well-known/mcp-registry-auth&lt;/code&gt;. That file deploys with the site, so no DNS change was needed. The private key stays on my machine and out of the repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd flag as unverified
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;On Vercel, the rewrite that serves Markdown should run before the cache, so a browser cannot be served cached Markdown. I inferred this and did not measure it.&lt;/li&gt;
&lt;li&gt;The server sends no CORS headers, so a browser-based client could not connect directly. Claude, ChatGPT and Cursor connect from their own apps or servers, but I have not tested each one.&lt;/li&gt;
&lt;li&gt;Cold starts on a Vercel Hobby function are slower than the 7 to 28 ms I measured warm on a local build.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No search engine finds an MCP server on its own, so this is a convenience and a demonstration, not a ranking signal.&lt;/p&gt;

&lt;p&gt;The site is at &lt;a href="https://karthik.nz" rel="noopener noreferrer"&gt;https://karthik.nz&lt;/a&gt;, and each decision is written up as an ADR in the repo.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>ai</category>
      <category>mcp</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Adding 8 working hours is harder than it looks</title>
      <dc:creator>Karthik Parameshwara</dc:creator>
      <pubDate>Fri, 30 Oct 2026 12:58:05 +0000</pubDate>
      <link>https://dev.to/k4rthik_/adding-8-working-hours-is-harder-than-it-looks-36f</link>
      <guid>https://dev.to/k4rthik_/adding-8-working-hours-is-harder-than-it-looks-36f</guid>
      <description>&lt;p&gt;A support desk in London works 09:00 to 17:00 on weekdays, with a lunch hour, and is closed on 25 and 28 December 2026. A ticket comes in at 16:30 on Christmas Eve with an 8-hour SLA. When is it due?&lt;/p&gt;

&lt;p&gt;The answer is 09:30 on Wednesday 30 December. Getting there means skipping lunch hours, a weekend and two holidays, all in the desk's own time zone. That's business-time arithmetic, and it turns up everywhere: support SLAs, payroll and overtime, delivery ETAs that only count operating hours, staff rosters.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://github.com/Karthik-beta/workclock" rel="noopener noreferrer"&gt;workclock&lt;/a&gt;, an open-source library for it: one Rust core, published for Rust, Python and JavaScript. This post walks through the cases that make the problem harder than it looks, and how workclock handles each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why another library
&lt;/h2&gt;

&lt;p&gt;I'd worked on this kind of problem before, with shifts that run past midnight. In Python, the usual library for it is businesstimedelta. Its last release, 1.0.1, came out in September 2019, and several of its bugs are still open. I wanted a maintained replacement that gets the edge cases right, and that existing code could move to without a rewrite.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two questions
&lt;/h2&gt;

&lt;p&gt;A business-time library answers two questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How much working time lies between two instants?&lt;/li&gt;
&lt;li&gt;Which instant do you reach after adding or subtracting an amount of working time?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In workclock, a schedule is built from rules. Working-hour rules produce blocks of working time; breaks and holidays produce time off. The schedule's working time is the union of the working blocks minus the union of the time off. Every operation is defined on that set, so the order you list the rules in never matters, and overlapping rules never count time twice.&lt;/p&gt;

&lt;p&gt;That definition sounds obvious. Most of the bugs below come from code that doesn't quite follow it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard case 1: shifts that cross midnight
&lt;/h2&gt;

&lt;p&gt;Take a 22:00 to 06:00 shift, Monday to Friday. Between Monday 22:00 and Tuesday 06:00 there are clearly 8 working hours.&lt;/p&gt;

&lt;p&gt;businesstimedelta 1.0.1 counts 0. Adding 4 hours at Monday 22:00 lands on Wednesday 02:00 instead of Tuesday 02:00, and subtracting 4 hours from Tuesday 06:00 raises &lt;code&gt;OverflowError&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;workclock's rule: if a shift's end is at or before its start, the shift is overnight and the end falls on the next date. A shift belongs to the weekday it starts on, so a Friday 22:00 to 06:00 shift runs into Saturday morning, and no shift ends on Monday morning unless one starts on Sunday. A start equal to the end is a 24-hour shift. With that, the three answers above become 8 hours, Tuesday 02:00 and Tuesday 02:00.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard case 2: holidays
&lt;/h2&gt;

&lt;p&gt;Holidays look like the easy part. Two open businesstimedelta issues say otherwise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once a query passes the last date in the holiday list, it raises &lt;code&gt;TypeError&lt;/code&gt; (&lt;a href="https://github.com/seppemans/businesstimedelta/issues/8" rel="noopener noreferrer"&gt;#8&lt;/a&gt;, &lt;a href="https://github.com/seppemans/businesstimedelta/issues/10" rel="noopener noreferrer"&gt;#10&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;When the holidays and the working hours use different time zones, it can loop forever (&lt;a href="https://github.com/seppemans/businesstimedelta/issues/9" rel="noopener noreferrer"&gt;#9&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second one is subtle. A holiday defined in UTC under a Los Angeles workday doesn't remove the Los Angeles day: it removes 16:00 the day before to 16:00 on the holiday. In workclock, each rule has its own time zone, and holidays default to the schedule's zone rather than UTC, which avoids that mismatch. Dates after the last holiday are simply ordinary days.&lt;/p&gt;

&lt;p&gt;There's also a design question: what happens when an overnight shift runs into a holiday? workclock's answer is that a holiday removes calendar time, midnight to midnight, not whole shifts. A shift that crosses into a holiday loses only the part after midnight. Keeping it that simple keeps the rules independent of each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard case 3: daylight saving time
&lt;/h2&gt;

&lt;p&gt;Working hours are wall-clock times ("09:00 to 17:00 in Europe/London"), but durations are elapsed real time. So a shift that spans a DST change is an hour shorter or longer than it looks. In America/New_York, a 22:00 to 06:00 shift is 7 hours on the night of Saturday 7 March 2026, when clocks jump forward, and 9 hours on the night of Saturday 31 October 2026, when they fall back.&lt;/p&gt;

&lt;p&gt;DST also creates local times that don't exist and local times that happen twice. workclock resolves them with the same "compatible" strategy as jiff, RFC 5545 and JavaScript Temporal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A time in the spring-forward gap moves forward by the length of the gap: 02:30, on a day when clocks jump from 02:00 to 03:00, becomes 03:30.&lt;/li&gt;
&lt;li&gt;A time in the fall-back overlap resolves to the earlier occurrence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Following the same rule as those ecosystems means the three bindings agree with the date libraries people already use in each language. (businesstimedelta, through pytz's &lt;code&gt;localize()&lt;/code&gt;, picks the later occurrence. That's one of the differences listed in the migration guide.)&lt;/p&gt;

&lt;p&gt;A holiday on a DST transition day is still midnight to midnight, so it's shorter or longer than 24 hours by the size of the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard case 4: searches that never end
&lt;/h2&gt;

&lt;p&gt;Ask for "8 working hours from now" on a schedule with no working time, and a naive implementation loops forever. In businesstimedelta, a rule with no working time hangs on addition.&lt;/p&gt;

&lt;p&gt;In workclock every search is bounded. A schedule with no working time fails when it's built. &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;sub&lt;/code&gt; and the period lookups stop with an error if they cross 366 days, plus seven days per holiday date, without finding working time. Library code doesn't panic: failures are errors, never hangs.&lt;/p&gt;

&lt;p&gt;One smaller fix: &lt;code&gt;between(a, b)&lt;/code&gt; is signed. If &lt;code&gt;b&lt;/code&gt; is before &lt;code&gt;a&lt;/code&gt;, the result is negative, the same as subtracting two datetimes (&lt;a href="https://github.com/seppemans/businesstimedelta/issues/12" rel="noopener noreferrer"&gt;#12&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like
&lt;/h2&gt;

&lt;p&gt;Here's the support desk from the top, in Python:&lt;br&gt;
&lt;/p&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;date&lt;/span&gt;&lt;span class="p"&gt;,&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;time&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;zoneinfo&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ZoneInfo&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;workclock&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Break&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Holidays&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Schedule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;WorkDay&lt;/span&gt;

&lt;span class="n"&gt;london&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ZoneInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Europe/London&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;support&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Schedule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="nc"&gt;WorkDay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;  &lt;span class="c1"&gt;# Monday to Friday by default
&lt;/span&gt;        &lt;span class="nc"&gt;Break&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
        &lt;span class="nc"&gt;Holidays&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;)]),&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;time_zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;london&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;opened&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tzinfo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;london&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;support&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;opened&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hours&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 2026-12-30 09:30, London time
&lt;/span&gt;&lt;span class="n"&gt;support&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;opened&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tzinfo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;london&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# 2:30:00
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JavaScript package takes &lt;code&gt;Date&lt;/code&gt;s or ISO 8601 strings, and durations in milliseconds:&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Schedule&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;workclock&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;support&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;Schedule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&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;Europe/London&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;workday&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;09:00&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;17:00&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="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;break&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12:00&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;13:00&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="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;holidays&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;dates&lt;/span&gt;&lt;span class="p"&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;2026-12-25&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;2026-12-28&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="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;support&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2026-12-24T16:30:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="nx"&gt;_600_000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Date 2026-12-30T09:30:00.000Z&lt;/span&gt;
&lt;span class="nx"&gt;support&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2026-12-24T16:30:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&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;2026-12-29T11:00:00Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 9000000 ms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have existing businesstimedelta code, most of it runs unchanged with one import change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;workclock.compat&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;businesstimedelta&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The businesstimedelta test suite runs against &lt;code&gt;workclock.compat&lt;/code&gt; in CI, and &lt;a href="https://github.com/Karthik-beta/workclock/blob/main/MIGRATING.md" rel="noopener noreferrer"&gt;MIGRATING.md&lt;/a&gt; lists where it intentionally differs.&lt;/p&gt;

&lt;h2&gt;
  
  
  One core, three languages
&lt;/h2&gt;

&lt;p&gt;The core is written in Rust on top of &lt;a href="https://docs.rs/jiff" rel="noopener noreferrer"&gt;jiff&lt;/a&gt;. Python gets it through PyO3 and JavaScript through WebAssembly, so all three languages share one implementation instead of three that drift apart. The Python wheels and the npm package bundle the IANA time zone database, so they don't depend on the system's tzdata.&lt;/p&gt;

&lt;p&gt;Every rule is specified with examples in a &lt;a href="https://github.com/Karthik-beta/workclock/blob/main/DESIGN.md" rel="noopener noreferrer"&gt;design document&lt;/a&gt;. Each example has an ID and becomes a test in every binding it applies to, and each binding is checked against a brute-force reference implementation with property-based tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed
&lt;/h2&gt;

&lt;p&gt;Correctness was the point, but the engine's design also makes it fast. It computes working time a week at a time, and a week with no DST change and no holiday near it is the same as the week before, so a long span adds the previous week's total instead of rebuilding it. The cost of a span depends on how many of its weeks hold holidays or DST changes, not on its length.&lt;/p&gt;

&lt;p&gt;Medians from Python, in a &lt;a href="https://github.com/Karthik-beta/workclock/actions/runs/40285792116" rel="noopener noreferrer"&gt;GitHub Actions run&lt;/a&gt; on a GitHub-hosted Ubuntu runner (AMD EPYC 7763, 4 cores), against businesstimedelta 1.0.1:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Case&lt;/th&gt;
&lt;th&gt;businesstimedelta 1.0.1&lt;/th&gt;
&lt;th&gt;workclock&lt;/th&gt;
&lt;th&gt;Speed-up&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One call, a 5½-hour span&lt;/td&gt;
&lt;td&gt;169 µs&lt;/td&gt;
&lt;td&gt;3.96 µs&lt;/td&gt;
&lt;td&gt;43×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One call, a year with bank holidays&lt;/td&gt;
&lt;td&gt;53 ms&lt;/td&gt;
&lt;td&gt;85.4 µs&lt;/td&gt;
&lt;td&gt;620×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1,000,000 pairs&lt;/td&gt;
&lt;td&gt;9.9 min&lt;/td&gt;
&lt;td&gt;2.13 s (&lt;code&gt;between_many&lt;/code&gt; on NumPy arrays)&lt;/td&gt;
&lt;td&gt;280×&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To be fair to the standard library: for one short span, a loop written by hand with &lt;code&gt;datetime&lt;/code&gt; and &lt;code&gt;zoneinfo&lt;/code&gt; keeps up (4.01 µs), because most of workclock's call goes on converting datetimes into and out of Rust. workclock pulls ahead as spans get longer or calls are batched, and that hand-written loop handles only one fixed schedule, without overnight shifts or per-rule time zones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo add workclock jiff
pip &lt;span class="nb"&gt;install &lt;/span&gt;workclock
npm i workclock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;workclock is pre-1.0, so the API may still change in a minor release.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docs: &lt;a href="https://workclock.karthik.nz/docs/" rel="noopener noreferrer"&gt;workclock.karthik.nz/docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Playground: &lt;a href="https://workclock.karthik.nz/playground/" rel="noopener noreferrer"&gt;workclock.karthik.nz/playground&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code: &lt;a href="https://github.com/Karthik-beta/workclock" rel="noopener noreferrer"&gt;github.com/Karthik-beta/workclock&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you find a case it gets wrong, an issue on GitHub is the best place to tell me.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm &lt;a href="https://karthik.nz" rel="noopener noreferrer"&gt;Karthik Parameshwara&lt;/a&gt;, a software engineer in Bengaluru. More of my work is at &lt;a href="https://karthik.nz" rel="noopener noreferrer"&gt;karthik.nz&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>python</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
