CakePHP 3 time column gets date added

后端 未结 2 1384
庸人自扰
庸人自扰 2020-12-04 02:59

I have a number of columns defined in my MySQL database as \"time\". That is, they have a time, but not a date. When they are read by the CakePHP 3 ORM, they are being conve

2条回答
  •  遥遥无期
    2020-12-04 03:23

    the fact is cakePHP perform your time value as Time Object which extends carbon and dateTime so u get a full dateTime instance included date :(

    however u can easily perform an automatic set with your entity. U only have to use Accessors & Mutators describe here: http://book.cakephp.org/3.0/en/orm/entities.html#accessors-mutators

提交回复
热议问题