His question was about the lack of a field with type "time", and "date time" in FAPI. The forms allow a year, month, date, but not an hour, minute, second field. On 1/28/06, Robert Douglass <rob@robshouse.net> wrote:
Sammy Spets wrote:
AFAIK drupal doesn't have a time field with two dropdowns and a datetime where the date and time fields are combined into one to fully utilize the timestamp type of a DB.
$form['effective_date'] = array( '#type' => 'date', '#title' => t('Effective date'), '#default_value' => $node->effective_date ? array('day' => $node->effective_date[2], 'month' => $node->effective_date[1], 'year' => $node->effective_date[0]) : array('day' => format_date(time(), 'custom', 'j'), 'month' => format_date(time(), 'custom', 'n'), 'year' => format_date(time(), 'custom', 'Y')), '#required' => FALSE);