Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How can I change the date format to the UK format? (DD/MM/YYYY)
 
ONG
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-07-12
United Kingdom
 

Hi everyone

At the moment it’s being displayed in the US format MM/DD/YYYY. Does anyone know how to change this to DD/MM/YYYY?

Thanks!

ONG

 
Magento Community Magento Community
Magento Community
Magento Community
 
gadgetplay
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-05-03
Basingstoke, UK
 

You could always report it as a bug to the Magento team as if you have set your store up as a United Kingdom store, then technically it is actually a bug.

That way, it will be fixed in all future Magento releases.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Fontis
Sr. Member
 
Avatar
Total Posts:  99
Joined:  2007-08-31
Melbourne, Australia
 

Have you enabled the “English (United Kingdom)” locale? I’m pretty sure that’s where date formats are stored.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ONG
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-07-12
United Kingdom
 

Yes I have, though that made no difference.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sebastian G
Guru
 
Total Posts:  336
Joined:  2007-09-15
 

@ONG: You can implement such date format if you are running 1.1 versions.
Simply you just need to configure your locale settings to be in the correct format in the admin System> Configuration> General
By selecting In Countries options the default country (if it uses European format) and Locale options Matching the selection.

For admin View, you will also need to select the proper Locale from the bottom left drop-down “Interface Locale”.

you will see dates changing from Aug 27, 2008 3:57:43 PM (US format) to 27 Aug 2008 15:57:43 (UK format) wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
lausianne
Sr. Member
 
Total Posts:  82
Joined:  2010-03-23
 

There are a few settings in System > Catalog > Date & Time Custom Options

 
Magento Community Magento Community
Magento Community
Magento Community
 
kasssim
Jr. Member
 
Total Posts:  14
Joined:  2008-09-17
 
lausianne - 07 April 2010 10:37 AM

There are a few settings in System > Catalog > Date & Time Custom Options

thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagePsycho
Mentor
 
Avatar
Total Posts:  1702
Joined:  2009-06-23
 

In order to change the date format to any, you can simply use:

$fromDate '2011-12-11';
$toDateFormat 'd/m/Y';
$dateTimestamp Mage::getModel('core/date')->timestamp(strtotime($fromDate));
echo 
$formattedDate date($toDateFormat$dateTimestamp);

OR

$fromDate '2011-12-11';
$toDateFormat 'd/m/Y';
echo 
$formattedDate Mage::getModel('core/date')->date($toDateFormat strtotime($fromDate));

More about Dates in Magento:
Playing with Dates in Magento

Cheers!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ALOK GUPTA
Jr. Member
 
Total Posts:  4
Joined:  2012-09-19
 
Sebastian G - 27 August 2008 05:59 AM

@ONG: You can implement such date format if you are running 1.1 versions.
Simply you just need to configure your locale settings to be in the correct format in the admin System> Configuration> General
By selecting In Countries options the default country (if it uses European format) and Locale options Matching the selection.

For admin View, you will also need to select the proper Locale from the bottom left drop-down “Interface Locale”.

you will see dates changing from Aug 27, 2008 3:57:43 PM (US format) to 27 Aug 2008 15:57:43 (UK format) wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
horizon
Member
 
Total Posts:  34
Joined:  2009-08-24
 
MagePsycho - 07 February 2012 10:08 PM

$fromDate '2011-12-11';
$toDateFormat 'd/m/Y';
echo 
$formattedDate Mage::getModel('core/date')->date($toDateFormat strtotime($fromDate));

This approache is the easiest to implement especially with third-party extensions that simply won’t read Magento’s configured settings for date.
It has worked with dates retrieved as variables, i. e. $fromDate in the example, but also with dates retrieved as part of an array. For example, in the well-known Aheadworks Blog extension, $fromDate becomes $post->CreatedTime.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top