Skip to content

Main content

End Of Month Unknown Day Mask

Format an explicit year and month with an unknown-day mask or validated supplied day, without imputing month end.

Loading tool…

Description

Format a supplied civil month with either a validated day or an unknown-day mask.

Date formats distinguish calendar years from ISO week-years, known day precision from unknown-day masks, and midnight at the start versus end of a day. A fixed 86400-second day fraction does not encode civil timezone transitions. Partial-date wording preserves uncertainty rather than silently choosing a date.

Format a supplied civil month with either a validated day or an unknown-day mask.

When to use this tool

Use End Of Month Unknown Day Mask when you already have year, month, dayKnown, suppliedDay and need to format a supplied civil month with either a validated day or an unknown-day mask.

How to use the tool and how it works

  1. Enter year, month, dayKnown, suppliedDay. 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 dateText, precision. Use the output convention below.

Require year 0..9999 and month 1..12. When dayKnown=true require a real day in that month; otherwise suppliedDay must be exactly zero. Return YYYY-MM-DD or the literal YYYY-MM-?? mask with day/month precision.1

Input fieldMeaning and unitsAccepted input
yearYearRequired. Safe integer; minimum 0; maximum 9999.
monthMonthRequired. Safe integer; minimum 1; maximum 12.
dayKnownDay KnownRequired. Boolean.
suppliedDayReal month day when dayKnown=true; exactly zero sentinel when unknown.Required. Safe integer; minimum 0; maximum 31.
Output fieldInterpretationReturned shape
dateTextYYYY-MM-DD or literal YYYY-MM-??; unknown day is preserved rather than imputed to month end.Required. Text; maximum UTF-16 length 8192.
precisionPrecisionRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "year": 2024,
    "month": 2,
    "dayKnown": false,
    "suppliedDay": 0
  },
  "output": {
    "dateText": "2024-02-??",
    "precision": "month"
  }
}

Limitations and assumptions

  • Unknown means no day is supplied; the tool does not infer the end of the month, choose an imputed date or return a parseable full date for month precision.
  • 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

Use a complete calendar/timezone conversion when relating week dates, timestamps or local schedules. Preserve unknown precision explicitly and choose an endpoint policy before calculation; a formatter or fixed-day fraction does not resolve missing dates or civil-time rules.

References

  1. Calculation and input contract: date/end-of-month-unknown-day-mask — tool.io

Similar or alternative tools