Before February 29, test every form, renewal and report on a copy of the site: book the date, renew a membership dated that day, and run February's reports. Fix any home-made date checks you find.

A date the form will not accept

A curling club member tries to book a sheet of ice online for Wednesday, February 29. The form replies that the date is not valid and asks her to choose another.

She phones instead, and the manager books it by hand. No one at the club knew the form had a problem, because the date had not come up since the form was built.

February has 29 days this year, and the extra day falls on a Wednesday, five weeks from today. Code that has never met that date is about to.

Four years since the last one

The last February 29 was four years ago. Many booking forms, membership systems and reporting scripts used by small organisations have been written or rewritten since then.

Ordinary testing rarely includes a date that exists only one year in four. A script can run correctly every day for years and still fail on its first leap day.

Where date handling goes wrong

Most problems come from code that works out dates for itself instead of relying on the calendar built into the programming language:

Date pickers that pop up a small calendar usually get the month right, because they rely on the browser's own date functions.

The check that runs on the server after the form is sent is more often home-made.

One year after February 29

A membership bought on February 29 needs an expiry date next year, and there is no February 29 to give it. Different tools settle that in different ways.

Some languages roll the extra day forward to March 1, and some databases fall back to February 28.

A script that simply adds one to the year can produce an impossible date, which a database may refuse or store as a blank.

None of these answers is wrong in itself. The trouble is a club that has never decided which one it wants, and code that picks one by accident.

Forms that refuse the date

A form that refuses February 29 sends the member to the phone, or away. A form that accepts it but stores the wrong date is worse, because no one notices until the day.

Test both the form a member sees and the confirmation that follows.

A booking accepted on screen that shows March 1 in the email has been stored wrongly somewhere in between.

A worked example

A bridge club in Quesnel plays duplicate bridge on Monday, Wednesday and Friday afternoons in a community hall. Members reserve a seat for each game through the website and renew their membership online once a year.

A volunteer tested the site last week on a copy, with its clock set to February 29. The reservation form refused the date, because its check used a table that gave February 28 days.

The renewal script added one to the year to set the expiry, so anyone paying on February 29 would have been given February 29 next year. The attendance report for February stopped on the 28th.

The date check now uses the language's own calendar functions, and the report runs to the real last day of each month.

For renewals, the club's board made a choice: memberships that begin on February 29 expire on February 28. The script applies that choice deliberately, and the membership page states it for members.

Testing before the day

Use a test copy of the site, so trial bookings and renewals never reach real members or real accounts.

On the copy, book February 29, renew a membership dated February 29, and run February's reports. Then look at what was stored and what the emails said, not only at what the screen showed.

If the copy's clock can be set ahead, set it to February 29 and then to March 1, and let scheduled tasks run on both days.

Reminders, renewals and reports

Some problems appear only later. A renewal reminder set for one month before an expiry date has to cope with an expiry that falls at the end of February.

Write down the rules you choose, such as the date on which a leap day membership expires, so the next person to touch the code does not have to guess.

Who should look at the code

Many club sites were built by a member who volunteered years ago and has since stepped away. Whoever looks after the site now may never have opened the scripts that handle dates.

A developer can usually find every place the code handles dates in a short review, and fix the home-made ones before the day rather than after a member complains.

Ask for the findings in writing: which scripts handle dates, what each one now does, and what was changed.

The counter-case

Sites built on widely used platforms, such as WordPress, Joomla or Drupal, with well-kept booking and membership extensions, generally handle February 29 correctly. Their date handling has met earlier leap years on many other sites.

The risk sits in custom code: an old form, a renewal script added later, a report built in a hurry. A short test on a copy shows whether any of it applies.

Testing for February 29

  1. Make a copy of the site for testing.
  2. Book February 29 through every form that takes a date.
  3. Renew a membership dated February 29.
  4. Run February's reports and check the last day.
  5. Set the copy's clock to February 29 and March 1.
  6. Decide the expiry rule for leap day memberships.
  7. Fix and retest before February 29.

Step six is the one only the club can do. Code can produce February 28 or March 1 next year, but which one is fair to a member is a decision, and the code should follow it.

While someone is reviewing the club's scripts, it is worth checking who still has the file transfer login, for the reasons set out in a print shop's upload login shared with every customer.


Frequently asked questions

Why would a form refuse February 29?

Usually because its date check uses a fixed table that gives February 28 days, or a home-made leap year rule, instead of the calendar built into the language.

What happens when a script adds a year to February 29?

It depends on the tools. Some move the date to March 1, some to February 28, and some produce an impossible date that is refused or stored blank.

How is a leap year worked out?

Years divisible by four are leap years, except century years, which are leap years only when divisible by 400. That is why 2000 was one and 1900 was not.

How should we test for February 29?

On a copy of the site: book the date through every form, renew a membership dated that day, run February's reports and set the copy's clock ahead.

When should a leap day membership expire?

That is the club's decision, usually February 28 or March 1 the next year. Write the rule down and make the code follow it deliberately.

Do WordPress or Joomla sites have this problem?

The platforms themselves generally handle the date correctly. The risk is in custom forms, renewal scripts and reports added to them, which are worth testing.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Forms and renewals that have never met a leap day?

Let us test your site on a copy before February 29, and we will fix any date checks that fail.

Start a Conversation