How this calculator works
A shelf life is measured from the production or packing date, so the expiry date is that date moved forward by the stated period. Days and weeks are counted exactly on the calendar. Months are calendar months, which is what a 24 month shelf life means on a food label: November 1, 2026 plus 24 months is November 1, 2028. If the start date is the last day of a month and the target month is shorter, the day is clamped, so January 31 plus one month gives February 28 or 29. Working backwards, the calculator reports the gap in exact days and in whole calendar months.
Formula
expiration date = production date + shelf life, where days and weeks are exact day offsets and months and years move the calendar month. In the reverse direction, shelf life in days = O(expiration) - O(production), where O is the day number counted from 0001-01-01, and whole months count a month only once the same day number is reached.
Worked example
Produced 2026-11-01 with a 24 month shelf life, the expiry date is 2028-11-01. A production date of 2026-11-01 and an expiry of 2028-11-01 is 731 days and 24 whole months apart, because February 2028 adds a leap day.
Advertisement
Frequently asked questions
What is the difference between best before and expiry?
Best before describes quality: the food is still safe but may lose flavour or texture after that date. An expiry date is about safety, and in Canada only a small set of foods such as infant formula carry a true expiry date. Shelf life arithmetic is the same for both.
Do months mean 30 days here?
No. Month and year shelf lives move the calendar date rather than adding a fixed number of days, which is how food and drug labels are written. Use the days or weeks option when a label quotes a day count.
Why does a two year shelf life sometimes give 730 days and sometimes 731?
Leap years. A two year span that includes February 29 contains one extra day, so the day count differs even though the calendar date is exactly 24 months later.
Should the production date be the packing date?
Use whichever date the label counts from. Food usually counts from packing, while medicines and cosmetics count from manufacture, and the label always states which.