Zero pad Drupal 7 Form API Date Control day and month HTML select element I'm using the Form API Date controls for my form, and I am wondering if there is a way to zero pad the month and day values in the HTML select elements for values less than 10 at declaration time. I am using the following render array declarations in the page callback function. 

$form = array();

$form['date_from'] = array(
    '#title' =&gt; t('Date From'),
    '#type' =&gt; 'date',
);

$form['date_to'] = array(
    '#title' =&gt; t('Date To'),
    '#type' =&gt; 'date',
);


Which displays on the page as:



And creates the select element values (without zero padding):
I think you can use #date_format

  $format = 'm d Y';
  $form['date_from'] = array(
     '#type' =&gt; 'date',
     '#title' =&gt; t('select a date'),
     '#date_format' =&gt; $format,
   );


More values:
http://php.net/manual/en/function.date.php