Magento 2 Get Current Store Date Time

You can easily get Current Store Date Time by injecting in your class constructor in instance of

and use that one to get the DateObject. For example:

And then you can use it as followed:

Magento Format

You can use the Magento format with the different params for example:

0 = full, 1 = long , 2 = medium, 3 = short

Custom Format

or if you want to add your own format like this: