Social Icons

twitterfacebookgoogle pluslinkedinemail

Wednesday 28 February 2018

Magento 2 How to Get Current Store Date Time

Hello Friends,

if you want to display current date time zone wise in magento 2 than you can use this code. it will help you to display current timezone date.



$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objDate = $objectManager->create('Magento\Framework\Stdlib\DateTime\TimezoneInterface');
$objDate->date()->format('y-m-d H:i:s')



Hope this short article will help you fix date issue.

No comments :

Post a Comment

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement