Format date to ISO
Support documents without metadata