How detect format of date field in form alter?
For the Date popup selector, the #date_format element in the form element. For example:

    //The date field has the format of "d-m-Y"
    $form['date_field'] = array(
      '#type' =&gt; 'date_select',
      '#title' =&gt; t('My Date'),
      '#date_format' =&gt; 'd-m-Y',
      '#date_label_position' =&gt; 'within',
      '#date_year_range' =&gt; '0:+1',
      '#description' =&gt; t('This is a test date picker'),
      '#default_value' =&gt; date('Y-m-d H:i:s'),
    );


There's an D6 documentation page on d.o, but it's still valid for D7 last I looked.