Magento 2: How to change the Date format in frontend?

The question:

I need to display the date format as “d.m.Y” in front end and Email templates, Is there any solution to complete this requirement?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

Follow this from your Admin Panel Configuration

Stores > Catalog > Catalog >Date and Time Custom Options

You can set the Date order as you want in Date Fields Order, MM/DD/YY or DD/MM/YY or any things else, depend on the date format you require.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment