null check of format and value for getDatetimeFieldValue