Skip to content

Commit 55285d7

Browse files
authored
Refactor to set date with this format yyyy-MM-dd HH:mm:ss
1 parent dac57db commit 55285d7

File tree

1 file changed

+1
-13
lines changed
  • app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time

1 file changed

+1
-13
lines changed

app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,11 @@ public function beforeSave($object)
5353
} else {
5454
// convert to UTC
5555
$zendDate = Mage::app()->getLocale()->utcDate(null, $date, true, $this->_getFormat($date));
56-
$date = $this->removeTimezone($zendDate->getIso());
57-
$object->setData($attributeCode, $date);
56+
$object->setData($attributeCode, $zendDate->toString('yyyy-MM-dd HH:mm:ss'));
5857
}
5958

6059
return $this;
6160
}
62-
/**
63-
* Remove the timezone format
64-
*
65-
* @param string $date
66-
* @return string
67-
*/
68-
public function removeTimezone($date): string
69-
{
70-
return strtr($date, ["+00:00" => "", "T" => " "]);
71-
}
72-
7361
/**
7462
* Convert create date from UTC to current store time zone
7563
*

0 commit comments

Comments
 (0)