Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

how to add date attribute with time using mysql setup file for my module
 
MagikMahesh
Member
 
Total Posts:  36
Joined:  2012-04-10
 

grin i am new with magento and i am using magento 1.7.

i want to add an date attribute with time which saves date as well as time in database for that product.

i had tried this code to add new attribute using mysql-setup file in my module..
.
.
.
$setup->addAttribute(’catalog_product’, ‘p_date’, array(
‘group’ => ‘General’,
‘input’ => ‘date’,
‘type’ => ‘datetime’,
‘label’ => ‘P Date’,
‘backend’ => “eav/entity_attribute_backend_datetime”,
‘visible’ => 1,
‘required’ => 0,
‘user_defined’ => 1,
‘searchable’ => 1,
‘filterable’ => 1,
‘comparable’ => 1,
‘visible_on_front’ => 1,
‘visible_in_advanced_search’ => 0,
‘is_html_allowed_on_front’ => 1,
‘global’ => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
.
.

but this gives me only date to select not time.
please help for this problem.
how should i add date attribute with time in magento.
or give me other solution if it has.
Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nirav1111
Jr. Member
 
Total Posts:  1
Joined:  2012-03-16
 

hi,
u should use type ‘time’ instread of ‘datetime’ wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
AlenaTsareva
Jr. Member
 
Total Posts:  1
Joined:  2012-05-23
 

I also encountered this problem.  And I tried use type `time` but this not help me. If anybody has found a solution please help me. red face

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top