Description
Encode supplied date-component presence into a bit mask and hierarchy flag.
Timestamp notation distinguishes written precision, quantization and carry into the next larger field. Padding a fraction, rounding it and propagating an end-of-day marker are different operations and do not establish clock accuracy.
Encode supplied date-component presence into a bit mask and hierarchy flag.
When to use this tool
Use Calendar Date Component Mask when checking one explicit timestamp precision, rounding or carry convention.
How to use the tool and how it works
- Enter yearPresent, monthPresent, dayPresent. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read mask, hierarchical. Inspect hierarchical before interpreting the associated values.
Encode supplied date-component presence into a bit mask and hierarchy flag. Year/month/day contribute 4/2/1; hierarchical requires day implies month and year, and month implies year.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| yearPresent | Year Present | Required. Boolean. |
| monthPresent | Month Present | Required. Boolean. |
| dayPresent | Day Present | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| mask | Mask | Required. Safe integer. |
| hierarchical | Hierarchical | Required. Boolean. |
{
"input": {
"yearPresent": true,
"monthPresent": true,
"dayPresent": false
},
"output": {
"mask": 6,
"hierarchical": true
}
} Limitations and assumptions
- Flags describe presence only, not valid numeric values, an actual date or an instant.
- 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.
Alternative or Complementary methods
Use complete date-time arithmetic when a carry must change a date or interact with timezone transitions.
References
Similar or alternative tools
- Date: ISO Date Reduced Precision Label
Classify validated reduced date precision.
- ISO 8601 Unknown Component Mask
Inspect known components in a restricted partial-date spelling.