The default date format for the 'date added' in News is US format.
I'd actually like to have "4 October 2006", but at least it should be "dd-mm-yyyy" (not "mm-dd-yyyy")
Does anyone know how I can do this?
Many thanks.
Mark
News Date Format
Re: News Date Format
Extensions > Modules click News or Help...
(optional) dateformat="%b %d, %Y" - Format to display the article's post date with. This is based on the strftime function and can be used in your template with $entry->formatpostdate. It defaults to %x, which is the default date format for the server's locale.
(optional) dateformat="%b %d, %Y" - Format to display the article's post date with. This is based on the strftime function and can be used in your template with $entry->formatpostdate. It defaults to %x, which is the default date format for the server's locale.
Re: News Date Format
Many thanks for this. Only thing is it doesn't seem to be making any difference. This is what I have:
{$entry->formatpostdate dateformat="%b %d, %Y"}
I am doing something wrong here?
Thanks,
Mark
{$entry->formatpostdate dateformat="%b %d, %Y"}
I am doing something wrong here?
Thanks,
Mark
Re: News Date Format
Looks OK... maybe the WYSIWYG changed the double quotes to "?
Try using single quotes instead.
Try using single quotes instead.
Re: News Date Format
Hmm, the dateformat parameter should be used on the news module call, not inside the template:
Code: Select all
{news dateformat="%b %d, %Y"}
Re: News Date Format
Inside the template you could use Smarty's dateformat modifier:
Regards,
D
Code: Select all
{$entry->formatpostdate|date_format:"%b, %d %Y"}
D
Re: News Date Format
All parameters shown in the Help are to be added to the 'tag' when used in template or page...
Re: News Date Format
Thanks very much Dee & Mark.
The Smarty dateformat modifier did it:
{$entry->formatpostdate|date_format:"%d %B %Y"}
gives me extaclty what I wanted.
Cheers!
Mark
The Smarty dateformat modifier did it:
{$entry->formatpostdate|date_format:"%d %B %Y"}
gives me extaclty what I wanted.
Cheers!
Mark
Re: News Date Format
I eventually found the dateformat code shown on "Extensions > Modules click News or Help..." mark mentioned on line 81 of modules/news/News.module.php and changed it to:
but this did not work.
In which file and where exactly should one make this mod.
Thanks
Code: Select all
$this->CreateParameter('dateformat', '%D %j %M %Y', $this->lang('helpdateformat'));
In which file and where exactly should one make this mod.
Thanks