Thursday 18 March 2010

Exploring a Domino Date Bug

I've been exploring a date issue that landed on my desk earlier in the week.   That's one of the joys of being an Administrator that has a handle on how to develop web applications in Lotus Domino.

I'll set the scene.

  1. The client has a dual language system.  English and French.  They can choose in the application whether a particular user sees the English or French interface.
  2. Some users use an English browser, some use a French browser.  It's their choice.
  3. The client has a preferred date format.  In the English interface, it is MMM-DD-YYYY.  The MMM could be 'Jan' for January, 'Feb' for February or 'Mar' for March.  In the French interface, it is basically the same, but uses French language abbreviations.  'janv.' for January, 'fev.' for February, 'mars' for March.
There are 4 different usage scenarios.
  1. English interface, English browser
  2. English interface, French browser
  3. French interface, French browser
  4. French interface, English browser
They all work perfectly but one.  Number 2.  And only for a select few dates.

If you switch your Regional Settings to 'French (Canada)', and you are using the English interface of the application, and you enter a date like 'Mar-01-2010', Domino will store the date as '01/01/2010' (the server's date settings are mm/dd/yyyy).

It gets more interesting, if you enter 'Mar-08-2010', the date gets stored as '08/01/2010', yes, that's right, August 1st, 2010.

I ran some tests, and discovered the following, using the French regional settings and the English date format:
  1. The month of January ('Jan-01-2010' through 'Jan-31-2010') stores the correct date.
  2. The month of Febrary ('Feb-01-2010' through 'Feb-28-2010') stores the correct date.
  3. The month of March ('Mar-01-2010' through 'Mar-12-2010') stores the incorrect date.
  4. The month of March ('Mar-13-2010' through 'Mar-31-2010') stores the correct date.
  5. The month of April ('Apr-01-2010' through 'Apr-30-2010') stores the correct date.
  6. The month of May ('May-01-2010' through 'May-31-2010') stores the correct date.
  7. The month of June ('Jun-01-2010' through 'Jun-30-2010') stores the correct date.
  8. The month of July ('Jul-01-2010' through 'Jul-31-2010') stores the correct date.
  9. The month of August ('Aug-01-2010' through 'Aug-31-2010') stores the correct date.
  10. The month of September ('Sep-01-2010' through 'Sep-30-2010') stores the correct date.
  11. The month of October ('Oct-01-2010' through 'Oct-31-2010') stores the correct date.
  12. The month of November ('Nov-01-2010' through 'Nov-30-2010') stores the correct date.
  13. The month of December ('Dec-01-2010' through 'Dec-31-2010') stores the correct date.
So, it's only the first 12 days of March that cause an issue.  And it doesn't matter what the year is.

What causes this?
I've spoken with IBM support, and one of the application developers, and here is why it is happening:
Depending on your server settings (either on the Server document or in your Internet Site document.  See fig 1.), the server will either use the Server's regional locale, or the browser's accept-language.

Fig 1. Internet Site Document

In this case, it is using the browser's accept-language.  When you change your regional locale on your computer (Windows in this case) the accept-language of your browser changes too (Internet Explorer in this case).  Domino looks at the incoming date format ('MMM-DD-YYYY') and determines that it is not an acceptable date format for that accept-language.  The date ends up getting recorded incorrectly.

The part that confuses me, is why does 'Mar-13-2010' get recorded correctly, and 'Mar-12-2010' and earlier not get recorded correctly?  (For reference, 'Mar-12-2010' gets recorded as '12/01/2010'.)

What I've done
I've asked IBM for a fix, so we will see what will come of that.

The affected versions that I have tested are:
  • Lotus Domino 8.5FP1
  • Lotus Domino 6.5.6FP3
I'm guessing that this is also an issue in anything that falls between these.

Why this is important to me?
I'm from Canada.  We're a bilingual society where people can work in the language they prefer.  In this case, someone whose browser (and complete operating system) is in French, prefers to work with the English interface because it is easier to communicate with their co-workers who are English.

At this point I either have to:
  1. Force the user to work in the French interface. (Not going to happen.)
  2. Recode every document save to translate the date entered as 'Mar-DD-YYYY' to '03/DD/YYYY' before saving.
  3. Hope that IBM will release a fix for me.


  1. One time IBM released a version of Domino which was fine in international english but not in french. So all my clients in Paris were upset.
    Any chance it is the domino OS at fault? Or the french browser/java?
    Seems odd enough.

  2. Another case of Notes being too smart for its own good? From March 13th on it can tell which number is the day and which the month, but for 3/1-3/12 there is more than one way to interpret the date. That is, 3/12 could be March 12 or 3 December.

  3. @ 1 - The Domino OS is Windows 2003. I'm not sure how it could be the server OS, as only Domino comes in contact with the data. It's posted directly to Domino which then stores it.

    I can duplicate the same issue that the client is having by switching my English browser to French using the Regional settings. We're using different browser versions, and the result is the same.

    IBM explained that the reason for it is that the date is not a valid format for the accept-language of the browser. But why wouldn't fail on the rest of the month, or any other months then?

    There's no java in use.

    @2 - I could accept that, however the day always ends up being the first of the month, so it's not just reversing them.

  4. same problem here,
    dojo set to 'it-it'
    date posted to the domino as yyyy-mm-dd
    date on domino set as dd/mm/yyyy custom (it work different the user settings!)

    with dojo.calendar enabled dates are stored as you posted earlier...

    instead with xpages it works fine.

  5. Another case of Notes being too smart for its own good? From March 13th on it can tell which number is the day and which the month, but for 3/1-3/12 there is more than one way to interpret the date. That is, 3/12 could be March 12 or 3 December.