philwilson.org

Timestamps and UTC in Axis

10 July, 2005

Aaron Johnson recently had some fun with Axis / SOAP, Java and Calendar, which reminded me of an issue I had on my last project – our Axis-based app had been working fine for a few months, but we came in one morning to find that all our reporting tools were telling us that the clients thought our server was an hour out.

After many hours of scratching our heads, we suddenly realised that we’d just switched from GMT into BST and the applications hadn’t accounted for this. Like Aaron, we hadn’t realised that Axis’ CalendarDeserializer class internally converts everything to UTC since whilst we’d been developing everything was UTC. As soon as the last Sunday in March came around – bam!

Lesson I learned: always beware of what third party libraries are doing to your data. Unit tests should be your friends!

See other posts tagged with general and all posts made in July 2005.