Timestamps and UTC in Axis

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!

Published by

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.