Support encoding of date/datetime objects