--- date.inc	Thu Feb 22 00:58:24 2007
+++ new/date.inc	Thu Mar 22 13:35:40 2007
@@ -777,7 +777,7 @@ function date_select_input($params) {
 
   if ($formats['input']['am_pm']) {
     $hours_format = 'g';
-    for ($i = 0; $i <= 12; $i++) $hours_array[$i] = $i < 10 ? "0$i" : $i;
+    for ($i = 1; $i <= 12; $i++) $hours_array[$i] = $i < 10 ? "0$i" : $i;
   }
   else {
     $hours_format = 'G';
@@ -1079,6 +1079,10 @@ function date_selector_make_dbdate($arra
 
   // adjust back to 24 hours time if 12 hours input was collected
   if ($array['ampm'] == 'pm' && $array['hours'] < 12) $array['hours'] += 12;
+  if ($array['ampm'] == 'am' && $array['hours'] == 12) {
+    $array['hours'] = 0;
+    $array['seconds'] = 1;
+  }
 
   // try to construct a date from the submitted values
   $date = date_make_date();
