fix for non-default date/time formats

  * format the output in the same way that we
    expect the input, otherwise the widget can't
    parse it and the datetime gets empty; this
    can happen if the form is re-submitted due
    to an error in a different form field.