Just another WordPress.com weblog

Hello Friends …
If you want attribute type as Datetime instead of date Change in following files…

Put this line at top of Function

$outputFormat = Mage::app()->getLocale()->getDateTimeFormat( Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);


$displayFormat = Varien_Date::convertZendToStrFtime($outputFormat, true, (bool)$this->getTime());

with this

$displayFormat = Varien_Date::convertZendToStrFtime($outputFormat = Mage::app()->getLocale()->getDateTimeFormat( Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));

And Replace

$this->getTime() ? ‘true’ : ‘false’


$this->getTime() ? ‘true’ : ‘true’

Also change in

public function date($date=null, $part=null, $locale=null, $useTimezone=true)

in this function Change this

$date = new Zend_Date($date, $part, $locale);

With this

$date = new Zend_Date($date, “”, $locale);

Vishal Surani

Comments on: "DateTime Attribute for Admin->Products" (1)

  1. hello its not working properly, it saves time but not date is not saved properly as when i choose 28 july, 2011 06:28 and in DB it saved as ” 0011-07-28 06:28:00 ” plz help .
    i am using Magento

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: