Inconsistency with date fields in the API
We've worked this out to handle form creation for civicrm fields in the CiviCRM entity project. https://drupal.org/project/civicrm_entity

We use the 'type' property returned from a getfields api call like so:
This code here we determine what widget to use:
checkout civicrm_entity.module 
civicrm_entity_get_field_widget()
the section pertaining to dates:

 if (isset($field_spec['type'])) {

        switch($field_spec['type']) {
          case 4:
            $widget = array('widget' =&gt; 'date_select','format' =&gt; 'Y:m:d');
            break;
          case 8:
            $widget = array('widget' =&gt; 'date_select','format' =&gt; 'H:i:s');
            break;
          case 12:
            $widget = array('widget' =&gt; 'date_select','format' =&gt; 'Y:m:d H:i:s');
            break;
        }
      }


so the '#type' of the form element is set to 'date_select' and the format is used to set the '#format' property
this does require the date_api module from the Date project