It appears that column data type TIME
(not datetime
, just the time of day, for example 12:00
) is not supported in Magento 2
.
I need to store a time of day, how to work around this?
How should I go about it with the tools and datatypes that are available?
I thought about saving a normal but distinctive date (like 1970-01-01 12:00:00
which is distinctive enough not to be confusing to anyone browsing the data) and just extracting the time part from it in the UI
, but it's horrid and makes me cringe inside.
Is there a more elegant way?
Magento\Framework\DB\Ddl\Table
with my own additions and b) editMagento\Framework\DB\Ddl\Table
directly, but that didn't help (got all sort of errors on setup:upgrade ). Could you be more specific with what you mean by creating a TIME format? Zend db should support time data type, but 1. editing and adding 'TIME' column type in class Magento\Framework\DB\Ddl\Table 2. calling Table->addColumn with 'TIME' type and any combination of options just causes[Zend_Db_Exception] Invalid column definition data