Description
Parse expiryDate and arrivalDate as real Gregorian dates.
Inventory dates and elapsed-time rules describe a stated stock record. A date comparison can apply a supplied shelf-life rule, but it cannot determine the physical condition or suitability of stored goods.
Parse expiryDate and arrivalDate as real Gregorian dates.
When to use this tool
Use Stock Shelf Life Arrival Margin when you need a repeatable stock-date calculation using an explicit origin and limit.
How to use the tool and how it works
- Enter arrivalDate, expiryDate, minimumRemainingDays. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read remainingDays, marginDays, meetsSuppliedMinimum. Inspect meetsSuppliedMinimum before interpreting the associated values.
Parse expiryDate and arrivalDate as real Gregorian dates. Return expiry minus arrival in days and subtract minimumRemainingDays for marginDays, with an inclusive meetsSuppliedMinimum comparison.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| arrivalDate | Arrival Date | Required. Text; maximum UTF-16 length 8192. |
| expiryDate | Supplied expiry date; boundary inclusion follows the comparison above. | Required. Text; maximum UTF-16 length 8192. |
| minimumRemainingDays | Minimum Remaining Days | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| remainingDays | Remaining Days | Required. Safe integer. |
| marginDays | Margin Days | Required. Safe integer. |
| meetsSuppliedMinimum | Meets Supplied Minimum | Required. Boolean. |
{
"input": {
"arrivalDate": "2026-11-01",
"expiryDate": "2026-12-01",
"minimumRemainingDays": 14
},
"output": {
"remainingDays": 30,
"marginDays": 16,
"meetsSuppliedMinimum": true
}
} Limitations and assumptions
- Negative remaining life is retained; expiry conventions, storage conditions, product suitability, and safety are not verified.
- 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
Review storage conditions, product instructions, and the inventory system's complete stock policy separately.
References
Similar or alternative tools
- Housing Assistance Document Expiry
Parse real Gregorian expiryDate and appointmentDate.
- Backup Snapshot Age
Require asOfTimestampSeconds no earlier than snapshotTimestampSeconds and return their difference.