« Back to home

Domino date/time format gotcha

I inherited a legacy Domino application which had been coded to assume mm/dd/yyyy format for dates. Bad idea, but there’s a lot of it about.

I got a steady stream of users who complained that sometimes when they entered data via the web, the months and days were being switched around at random during save. Yet no matter how much I tried, I couldn’t reproduce the problem.

Days of attempted debugging followed. To cut a long story short, here’s what was going on:

At some point Domino gained a feature whereby it will attempt to pick a dynamic server locale based on the language preference set in the client web browser.

It doesn’t matter if you have a US server in the US, with its date format set to mm/dd/yyyy and instructions on your web forms to enter dates in that format, and have chosen a particular time zone to display all times in. Domino will ignore all that.

The default behavior is that Domino guesses a date format and time zone by looking at the connecting web browser’s language preferences. All code that you would expect to return the server’s information because it is evaluated on the server—such as @Text(@Time)—has its behavior modified as if the server’s locale had changed.

There’s a server option to disable this, and make the server consistently use the time zone and date formats it has actually been configured to use.

I just want to raise awareness of this issue, because it simply didn’t occur to me that my web browser language preference would change the apparent time zone and date format of the server. I only expected my language preferences to change the language displayed.

I can see how someone at IBM thought this would be a neat idea, but really…