laravel-admin默认时间不准确,这是在表模型中
/*
**时间字段
*/
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
/**
* 与模型关联的表名
*
* @var string
*/
protected $table = 'order';
/**
* 重定义主键
*
* @var string
*/
protected $primaryKey = 'id';
/**
* 指示是否自动维护时间戳
*
* @var bool
*/
public $timestamps = true;
/**
* The storage format of the model's date columns.
*修改时间为时间戳,启用则会转化为日期
* @var string
*/
protected $dateFormat = 'U';
const CREATED_AT = 'created_at'; const UPDATED_AT = 'updated_at';
为表时间字段,根据需要修改
/** * 指示是否自动维护时间戳 *开启之后更新数据会自动更改表时间 * @var bool */ public $timestamps = true;
/** //开启之后会把时间格式化日期 * The storage format of the model's date columns. *修改时间为时间戳 * @var string */ protected $dateFormat = 'U';
如果时间不准确,则找到 app/config 下app文件
改为中国时间即可 'timezone' => 'PRC',即可