•

AI Duration Extraction: Preserve the Kind of Time

A blank straight measuring tape contrasts with an irregular folded paper ring as a grayscale hand pauses between them.
What’s in this article?

    Keep calendar amounts, elapsed time and working time distinct when AI extracts a duration. Use an explicit acceptance contract before converting that amount or turning it into a due date.

    A request says, “Keep the record available for one month.” An AI extractor returns duration_days: 30. That looks convenient for the destination field, but the system has replaced the source instruction with an unstated convention.

    AI duration extraction should preserve the kind of time being counted, not just a number and unit. A calendar month, 30 elapsed days and 30 business days are different amounts. This guide proposes an application design for operational intake; its records and examples are illustrative, not a tested deployment or legal deadline advice.

    Classify the amount before choosing a storage format

    Separate three questions: what phrase appeared, what kind of amount it describes, and whether the application has enough context to apply it. A duration can be captured accurately even when no due date can yet be calculated.

    Recommended duration acceptance matrix
    Source meaningPreserveDo not silently substituteNeeded before application
    “Wait 48 hours” under an elapsed-time policyElapsed amount: 48 hoursTwo local calendar daysVerified starting instant and destination precision
    “Retain for one calendar month”Calendar amount: one month30 days or a fixed second countAnchor, calendar, relevant zone and month-end rule
    “Review within two business days”Business-time amount plus the “within” qualifier48 hours or two weekdays under an assumed calendarApplicable work calendar, start/counting rule, cutoff and endpoint convention
    “About three weeks”Amount plus approximationAn exact commitmentOwner-approved tolerance or explicit clarification
    “Two days” without an applicable policyLiteral components; kind unresolvedThe destination’s default day typeMeaning confirmed by authoritative context or a reviewer

    The spelling of a duration does not establish the receiving system’s arithmetic. Java’s Period documentation distinguishes a date-based amount from a time-based Duration: adding a conceptual day can preserve local time across a daylight-saving change, while an exact 24-hour duration can land at a different local hour. That is documented Java behavior, not a guarantee about every receiver.

    The Temporal.Duration documentation also distinguishes components: P1M means one month; PT1M means one minute. Its calendar-sensitive conversions can require a reference point. A syntactically valid string is therefore not evidence that conversion to seconds is appropriate.

    Give interpretation, calculation and commitment different owners

    The model receives permitted source text, document identity, nearby qualifiers and applicable policy context. It proposes the quoted span, components, semantic kind and unresolved questions. It should not invent a holiday calendar, choose a month-end convention or release an operational promise.

    • Rules validate: supported units, numeric bounds, qualifiers, required context and destination compatibility. Deterministic code performs authorized arithmetic under a named policy.
    • People decide: ambiguous business meaning, unsupported exceptions and consequential changes to an agreed commitment.
    • Systems preserve: original evidence, accepted interpretation, policy revision, derived result and the verified outcome of any authorized write.

    Do not force every extraction to become a timestamp. If the immediate task is recording a lead-time requirement, a typed amount may be the correct output. When a due date is actually needed, pass the accepted amount into a separate date-resolution workflow. A recurring rule needs its own recurring-work clock contract; one extracted duration does not define a schedule.

    Keep a duration record that exposes missing evidence

    The following fields are a proposed application contract, not an API schema. Require only what the intended action needs: storing a literal observation requires less context than changing a deadline.

    Evidence required for a duration decision
    Record groupFields to retainAcceptance question
    SourceDocument/message revision, exact phrase, location, event or field it modifiesCan a reviewer find the full instruction and its qualifiers?
    MeaningCalendar/elapsed/business/unresolved kind; original components; range, approximation and comparison wordsDid normalization change the instruction?
    Application contextAnchor event and revision; zone/calendar when relevant; counting, cutoff and overflow policy referencesIs the amount applicable here without guessed defaults?
    DestinationField type, accepted units, arithmetic semantics, precision and adapter versionWill the receiver preserve the accepted meaning?
    Decision and effectReviewer, accepted revision, derived value, authorized action identity, destination readbackWhat was approved, and did that exact change take effect?

    Record “calendar unavailable” separately from “calendar has no holidays.” Likewise, an unresolved kind is not zero duration. If only a scalar second count is supported downstream, keep calendar or business amounts held until an authorized calculation produces a supported result; do not discard meaning merely to satisfy the field type.

    Test month-end meaning and business-time meaning separately

    One month is not automatically 30 days

    Constructed example: a record begins at 09:00 UTC on January 31, 2027. The source says “one calendar month.” Suppose the responsible owner explicitly approves Gregorian calendar addition with an end-of-month clamp. Under that chosen policy, the result is February 28 at 09:00 UTC.

    Thirty elapsed 24-hour days from the same instant ends March 2 at 09:00 UTC. The results differ because the operations differ. The clamp is an example policy, not a universal interpretation of “month.” If the approved receiver rejects an invalid target day instead, preserve that outcome and route the exception rather than changing libraries until a date appears.

    Two business days needs a counting contract

    In another illustrative case, a complete request arrives Friday at 10:00. The approved rule excludes the receipt date, counts Monday–Friday, has no holidays in this interval, and sets the deadline at the close of the second counted day. The result is Tuesday at the defined closing time—not Sunday at 10:00.

    Change any premise and recalculate: a Monday closure, a Friday cutoff already passed, or a different receipt event can change the answer. The model must not borrow a calendar from the requester’s language or the worker’s device. This is a designed internal review rule, not a statement about statutory or contractual deadlines.

    Make uncertainty a resumable state, not a guessed conversion

    Use a lifecycle such as Captured → Typed → Context verified → Authorized → Applied → Verified. Add explicit Held, Rejected, Superseded and Outcome unknown branches. Define the evidence and owner needed to leave each branch.

    • Malformed or incomplete model output: preserve the source and validation errors. An eligible bounded interpretation retry uses the same source revision; it cannot supply missing policy authority.
    • Low-confidence or contradictory meaning: hold the affected action with a specific question, such as calendar day versus elapsed 24 hours. A confidence score alone cannot settle that distinction.
    • Unavailable calendar or resolver: retain the typed amount and last verified context. Resume only when the required dependency is available and applicable.
    • Human rejection or a revised source: retain the rejected proposal. Reinterpret the new evidence and obtain fresh authorization where meaning changes; do not carry approval across revisions silently.
    • Timeout after a destination write: mark the effect outcome unknown and reconcile the original operation through supported readback. Do not recompute a fresh deadline and send another write merely because acknowledgment was lost.

    Bind the effect identity to the business record, accepted source/decision revision and action type. Eligible execution retries reuse that identity under the destination’s demonstrated duplicate-protection contract. Close the case only when the intended record change—or a verified no-change disposition—is evidenced.

    Evaluate semantic preservation, not only parsed numbers

    Build paired acceptance fixtures before rollout. These are proposed tests, not claims of measured model performance:

    • “One month” and “30 days” remain distinct through serialization, adapter transfer and readback.
    • P1M and PT1M retain different units; unsupported syntax fails visibly.
    • “Two business days” with and without an available calendar produces a supported calculation versus a held calculation, not two confident answers.
    • “At least two hours,” “up to two hours” and “about two hours” retain different qualifiers.
    • A local calendar day and 24 elapsed hours cross a clock change under the declared adapter semantics without being treated as automatically equivalent.
    • A revised anchor invalidates the dependent calculation; replaying the original source creates no duplicate effect.

    Measure kind accuracy among adjudicated examples, qualifier preservation, unsupported-conversion releases, intervention rate and effect reconciliation time. Define each denominator and compare source-to-saved-record outcomes. A parser that returns every number can still fail the business task.

    Where Workhint fits

    The Workhint Workflow Engine describes role-routed approvals and required details, files or notes before work progresses. That supports defining who reviews unresolved duration meaning and what evidence they need.

    The Workflow Automation Software solution describes structured forms, conditional routing and human decisions. Those are relevant to collecting missing calendar context and coordinating a held request. These marketing descriptions do not establish a native duration parser, business-calendar resolver or revision-safe destination connector; validate those implementation requirements separately.

    Frequently asked questions

    Should every duration be stored in seconds?

    No. An elapsed amount may support that representation, but a calendar month or business-day amount can require context before any equivalent elapsed value exists. Preserve the original typed amount separately from a derived result.

    Does an ISO-style string settle the business meaning?

    No. Validate the receiving implementation, supported components and arithmetic policy. A portable-looking string does not identify a holiday calendar, counting rule or authorized anchor.

    Can AI select the business calendar?

    It may identify a candidate from supplied evidence. The applicable calendar and revision should come from an authoritative policy or an accountable reviewer, not a model guess.

    Must missing context block all storage?

    No. A literal observation can remain useful with unresolved fields. Block actions whose acceptance contract needs that context, rather than manufacturing a precise date.

    Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *


    The reCAPTCHA verification period has expired. Please reload the page.