Two directions, four units
Shelf life works both ways: production date forward to expiry, or expiry back to production. Units are days, weeks, months and years, and months cause most errors because their lengths vary. The right method steps by calendar month, advancing the same day number and falling back to the month's last day when the target month lacks it. January 31 with a one-month shelf life expires on 28 February, or 29 in a leap year, never 3 March. Days add directly and ignore months. The tool also accepts a days-after-opening limit, since usable time after opening is often shorter than the full printed shelf life.
Steps
- Enter the production date, or press today to fill it in.
- Choose production-to-expiry or the reverse direction.
- Enter the shelf life number and its unit.
- Add days after opening where packaging limits that, and the earlier date wins.
- For batches, write one record per line with segments separated by a vertical bar.
- Copy the output, export a calendar file or download the text record.
Month ends, leap years, opened products
Month-end handling is the heart of the algorithm: stepping to a day number that does not exist falls to the last day, which pulls dates earlier in shorter months. Leap years affect February only, so a February 29 start with a one-year shelf life lands on February 28. Year steps and month steps are the same logic, while writing 365 days loses a day in leap years. Days after opening form an independent timeline, such as twelve months sealed but thirty days once opened, and the earlier of the two governs. In batch mode, blank trailing segments inherit the settings above and a missing bar breaks the whole line.
Common mistakes
Treating a month as thirty days. Turning January 31 plus one month into 3 March. Writing a year as 365 days. Ignoring days after opening. Dropping the separator bar in batch input. And swapping production and expiry dates.
Where the date is not the whole story
The tool computes a calendar date and cannot reflect storage reality. A broken cold chain, sun exposure or moisture shortens real shelf life, so packaging conditions matter more than any computed date. Medicines and special foods follow their own expiry rules with inserts and batch numbers. In a food dispute, a date is one piece of evidence among intake and storage records. And judging edibility from a computed date should always be checked against appearance and storage conditions first.