public function value() { if (func_num_args() == 1) { $v = func_get_arg(0); // ctype_digit will fail on timestamps in the past, so typecast here if (substr($v, 0, 1) == '-' && ctype_digit(substr($v, 1))) { $v = (int) $v; } if (is_int($v) || ctype_digit($v)) { $v = strftime($this->datetime_format, (int) $v); } // unset default field value if ($v == 'MM/DD/YYYY HH:MM:SS') { $v = ''; } parent::value($v); } else { return parent::value(); } }