adrian holovaty

Low-tech edition (Skip to navigation)

April 4, 2003, 12:22 AM ET

Bumbling news sites display incorrect Baghdad time

A number of major news organizations' sites around the world have latched onto a peculiar trend: Displaying the current time in Baghdad.

Examples:

I won't comment on the usefulness of such a feature (I can see both arguments), but I will comment on the several incorrect techniques many sites have been using to display Baghdad time.

Problem #1: Relying on users' computers to provide accurate time

Here's an example: Visit the Los Angeles Times' home page in a graphical browser with JavaScript turned on, and you'll see a "Baghdad Time & Weather" sidebar in the right rail. It updates every second, making it look like a real clock.

Pretty cool, eh? I can practically see the men in suits patting themselves on the back, saying, "Man, this is great. We're really taking advantage of the medium."

Except...no. The clock may add a certain gee-whiz factor, but for many users, the information is inaccurate. The reason: It grabs the current time from your computer's operating system and calculates the time in Baghdad by adding (in the Times' case) 4 hours.

That means, if you set your system's clock to 8 a.m., latimes.com will dutifully report it's noon in Baghdad. And if you set it to noon, the clock will read "4 p.m." It's kind of fun to play with, once you figure it out.

How many users' system clocks are inaccurate? I don't know. Is Baghdad time critical information? No. But it's still a possible inaccuracy, and news organizations should strive to weed out inaccuracy (as the Los Angeles Times itself has done recently in another arena).

It comes down to this: As I said in a similar article last August, relying on client-side information to produce content that aims to be journalistically sound is a bad idea. Plus, relying on user-provided data on the Web is insecure and just plain naïve, in general. That's one of the hallmark rules of Web programming.

Problem #2: Relying on JavaScript

With JavaScript turned off, the headline "Baghdad Time & Weather" is a lie; the time simply isn't shown. The Times and its content-sharing partners could avoid this problem by placing a server-generated timestamp in a noscript tag: an adequate replacement.

Problem #3: Incorrect information, period

Take a look at the Orlando Sentinel's Baghdad clock (right side of page), the nbc-2.com clock and the aforementioned latimes.com clock. At time of this writing, Orlando is reporting it's 8:20 a.m. in Baghdad. NBC2 is reporting it's 7:20. Los Angeles is reporting it's 9:20.

How could that be? I don't know. Are those sites each assuming I live within their respective time zones, and calculating Baghdad time relatively, based on that incorrect assumption? Possibly. If you can figure it out, please share.

The best practice

The best solution, in my mind, is practiced by the New York Times. Its clock is generated by the server, not by JavaScript. Which means the site's reported time will stay unchanged until the page is refreshed -- but that's a small price to pay for accurate information.

Post a comment:

Comments on this entry are closed.

Don't see any comments? That's because my Web hosting provider has made a server upgrade that broke the commenting feature on this site. I'm working to restore that; please check back later.



Thanks for reading.

A Django site.