Use toISOString for date formatting.

Remove buggy manual date formatting and replace with
Date.toISOString() to get a properly formatted expiration for the
credential.