public function format_datetime($field)
    {
        $d = $this->current_row[$field];
        if (!$d) {
            $this->current_row[$field] = '-';
        } else {
            if ($d instanceof MongoDate) {
                $this->current_row[$field] = date(
                    $this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'),
                    $d->sec
                );
            } elseif (is_numeric($d)) {
                $this->current_row[$field] = date(
                    $this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'),
                    $d
                );
            } elseif ($d instanceof \DateTime) {
                $this->current_row[$field] = $d->format($this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'));
            } else {
                $d = strtotime($d);
                $this->current_row[$field] = $d
                    ? date(
                        $this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'),
                        $d
                    )
                    : '-';
            }
        }
    }
public function format_datetime($field)
    {
        $d = $this->current_row[$field];
        if (!$d) {
            $this->current_row[$field] = '-';
        } else {
            if ($d instanceof MongoDate) {
                $this->current_row[$field] = date(
                    $this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'),
                    $d->sec
                );
            } elseif (is_numeric($d)) {
                $this->current_row[$field] = date(
                    $this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'),
                    $d
                );
            } elseif ($d instanceof \DateTime) {
                $this->current_row[$field] = $d->format($this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'));
            } else {
                $d = strtotime($d);
                $this->current_row[$field] = $d
                    ? date(
                        $this->app->getConfig('locale/datetime', 'd/m/Y H:i:s'),
                        $d
                    )
                    : '-';
            }
        }
    }
public function format_datetime ( $ field ) { $ d = $ this -> current_row [ $ field ] ; if ( ! $ d ) { $ this -> current_row [ $ field ] = '-' ; } else { if ( $ d instanceof MongoDate ) { $ this -> current_row [ $ field ] = date ( $ this -> app -> getConfig ( 'locale/datetime' , 'd/m/Y H:i:s' ) , $ d -> sec ) ; } elseif ( is_numeric ( $ d ) ) { $ this -> current_row [ $ field ] = date ( $ this -> app -> getConfig ( 'locale/datetime' , 'd/m/Y H:i:s' ) , $ d ) ; } elseif ( $ d instanceof \ DateTime ) { $ this -> current_row [ $ field ] = $ d -> format ( $ this -> app -> getConfig ( 'locale/datetime' , 'd/m/Y H:i:s' ) ) ; } else { $ d = strtotime ( $ d ) ; $ this -> current_row [ $ field ] = $ d ? date ( $ this -> app -> getConfig ( 'locale/datetime' , 'd/m/Y H:i:s' ) , $ d ) : '-' ; } } }
Format field as datetime.

@param string $field
Format field as datetime .