# Service Period Calculator - Years, Months and Days of Service

Page: https://hirantha.me/tools/service-period-calculator
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-10-13

Years, months and days of service between two dates, the completed years that gratuity needs, and the date you reach five years.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Enter the first and last day of a job to see the exact length of service in years, months and days, the total days and the number of completed years. It also shows the date you reach five completed years, the service the Payment of Gratuity Act, No. 12 of 1983 asks for. The method is stated below, month ends are handled, and the dates stay in your browser.

The method counts whole months from the start date, keeping the same day of the month. The years are those months divided by 12, rounded down, and the months are the remainder. The days are what is left between that date and the end. Every step is calendar arithmetic on whole days, so no time zone or daylight saving can move a date.

By default the last day counts as a day of service. If your last day worked is 30 September, the period runs to the end of that day, which is the same as counting to 1 October. This is how the gratuity calculator counts. Turn it off to get the plain time between the two dates, one day shorter.

Month ends need a rule, and this is it: if the month has no day matching the start day (31 in a 30-day month, or 29 to 31 in February), that month is complete on the first day of the next month. So with the last day counted, 31 January to 28 February is exactly one month. A start on 29 February has its yearly anniversary on 1 March in a year with no 29 February, which is also how the gratuity calculator counts completed years, and the tests check that the two agree.

Completed years matter for gratuity. The Payment of Gratuity Act, No. 12 of 1983 gives a gratuity to a workman with at least five completed years of service when the employer has employed fifteen or more workmen on any day in the twelve months before the service ended, and it counts a year as a completed period of twelve months. A part year does not count. Probation, notice, service awards and pensions follow your employer's rules or your contract, and this page does not state any of them.

How edge dates are counted:
| Start | End | Last day counted | Result |
| --- | --- | --- | --- |
| 15 March 2018 | 30 September 2026 | Yes | 8 years, 6 months, 16 days (3,122 days) |
| 15 March 2018 | 30 September 2026 | No | 8 years, 6 months, 15 days (3,121 days) |
| 1 March 2020 | 28 February 2025 | Yes | 5 years, 0 months, 0 days (1,826 days) |
| 1 March 2020 | 27 February 2025 | Yes | 4 years, 11 months, 27 days |
| 31 January 2026 | 28 February 2026 | Yes | 0 years, 1 month, 0 days (29 days) |
| 31 January 2026 | 28 February 2026 | No | 0 years, 0 months, 28 days |
| 29 February 2020 | 28 February 2021 | Yes | 1 year, 0 months, 0 days |
| 29 February 2020 | 27 February 2021 | Yes | 0 years, 11 months, 30 days |

Q: How do I calculate years, months and days between two dates?
A: Count whole months from the start date, keeping the same day of the month. Years are those months divided by 12, the months are the remainder, and the days are what is left up to the end date. This tool does it for you and shows the total days as a check.

Q: Does the last day count as a day of service?
A: By default yes: a person who works 1 March to 28 February has served every one of those days. That is how the gratuity calculator counts, so the two agree. Choose No to get the plain time between the two dates, which is one day shorter.

Q: How many years of service do I need for gratuity?
A: At least five completed years under the Payment of Gratuity Act, No. 12 of 1983, with an employer who has employed fifteen or more workmen on any day in the twelve months before the service ended. The tool shows the date you reach five completed years. Use the gratuity calculator for the amount.

Q: What happens if the end date is before the start date?
A: The tool shows a message instead of a result and offers a button to swap the two dates. It does not guess which one you meant.

Q: How are month ends such as 31 January handled?
A: If the month has no day matching the start day, the month is complete on the first day of the next month. So with the last day counted, 31 January to 28 February is one month, and without it the same dates are 28 days. The table above shows more cases.

Q: Is a part year counted as a year?
A: No. Completed years are whole years only, so 4 years and 11 months is 4 completed years. The Gratuity Act counts a year as a completed period of twelve months.

Q: Does the calculator subtract unpaid leave or a break in service?
A: No. It measures calendar time between the two dates. If you had a break that your employer does not count, measure each stretch of service separately, and check your contract or ask the Department of Labour how the break is treated.

Sources: Payment of Gratuity Act, No. 12 of 1983 (full text) (https://lankalaw.net/wp-content/uploads/2025/02/1983Y0V0C12A.html); Department of Labour, Sri Lanka (https://labourdept.gov.lk/)

Related tools:

- [Gratuity calculator (Sri Lanka)](https://hirantha.me/tools/gratuity-calculator.md): Work out gratuity under the Payment of Gratuity Act: half a month's pay for each completed year after five years.
- [EPF & ETF calculator](https://hirantha.me/tools/epf-etf-calculator.md): Monthly EPF and ETF contributions on any salary, with a rough projection of your EPF balance.
- [Net salary calculator (Sri Lanka)](https://hirantha.me/tools/salary-calculator.md): Take-home pay after EPF and APIT income tax, plus what the employer really pays.
- [Days between two dates calculator](https://hirantha.me/tools/date-difference-calculator.md): Count the days between two dates in weeks, months and years, with business days, an end-date option and Sri Lanka holidays left out if you like.
- [Age calculator (years, months and days)](https://hirantha.me/tools/age-calculator.md): Exact age in years, months and days, days, weeks and hours lived, the next birthday and its weekday, and the age on any date.
