« Back to home

Attack of the Heisenbug

This week I battled a bug which was exceptionally sneaky at hiding itself. Consider the following Domino Java code accessing a single-valued date-only field: Document doc; […fetch document…] Vector v = doc.getItemValueDateTimeArray("SomeDateField"); DateTime dt = (DateTime) v.get(0); Date jdt = dt.toJavaDate(); System.out.println(dt.toString() + " = " + jdt.toString()); What happens when you run the code? Well, the getItemValueDateTimeArray() call fetches the contents of the Notes item (field) from the document, and returns it as a Vector of Notes DateTime objects.…

Read more »

Providing RFC3339 dates from Notes/Domino

I do a lot of integration work, and often it involves REST Web Services and other forms of XML data transfer. Generally I want to provide dates and times in RFC3339 format, or some variant of ISO8601; for example, 1996-12-19 16:39:57 -0800. When writing a Web Service in LotusScript, it’s not too hard; I built myself a function which converts a NotesDateTime or Variant of type 7 into UTC and then formats it appropriately, and I use that all over the place.…

Read more »

Chronological pitfalls

Since the US just changed time zone, and the EU will be changing time zone soon, it seems like a good time to refresh an old posting of mine about dates and times, and how hard it can be to do the right things with them in software. I’ve spent a lot of my career in the computer industry working on computer-based calendar systems and organizers of various kinds. Here are a few pitfalls to be aware of.…

Read more »