Skip to content

Main content

Public Calendar Day Start Offset Tool

Map a supplied clock onto an explicit fixed-length day-origin convention without calculating sunset or religious observances.

Loading tool…

Description

Subtract suppliedDayStart from recordedTime, divide by positive suppliedDayLength with floor for dayIndex, and return a nonnegative withinDay remainder.

Calendar coordinates depend on an era, origin, day-start rule, and sometimes an arithmetic rather than observational convention. A supplied coordinate difference does not resolve those choices.

Subtract suppliedDayStart from recordedTime, divide by positive suppliedDayLength with floor for dayIndex, and return a nonnegative withinDay remainder.

When to use this tool

Use Public Calendar Day Start Offset when you need a documented calendar convention or source-coordinate comparison.

How to use the tool and how it works

  1. Enter recordedTime, suppliedDayStart, suppliedDayLength. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read dayIndex, withinDay. Use the output convention below.

Subtract suppliedDayStart from recordedTime, divide by positive suppliedDayLength with floor for dayIndex, and return a nonnegative withinDay remainder.1

Input fieldMeaning and unitsAccepted input
recordedTimeRecorded TimeRequired. Finite number.
suppliedDayStartSupplied Day StartRequired. Finite number.
suppliedDayLengthSupplied Day LengthRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
dayIndexDay IndexRequired. Safe integer.
withinDayWithin DayRequired. Finite number.
json
{
  "input": {
    "recordedTime": 30,
    "suppliedDayStart": 6,
    "suppliedDayLength": 24
  },
  "output": {
    "dayIndex": 1,
    "withinDay": 0
  }
}

Limitations and assumptions

  • Origin and day length are supplied in compatible units; sunset, timezone changes, and astronomical timing are not calculated.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Consult the source calendar and authoritative date information for actual observance, conversion, or historical dating.

References

  1. Calculation and input contract: islamic-studies/public-calendar-day-start-offset — tool.io

Similar or alternative tools