Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

New Blog Entry date


Reply


5 Posts   809 Views

Avatar
purtle

Community Member, 4 Posts

16 January 2012 at 1:52pm

Hi

Just wondering if there is a way to fix the the New Blog Entry date, to change its default entry date from 1 Jan 1970, to always be the current day/date etc?

Any help appreciated.

Avatar
Optic Blaze

Community Member, 165 Posts

9 March 2012 at 12:37pm

Hi, what version of the Blog are you using. Version 0.4.1's new entry date defaults to today's date on my installation.

Avatar
purtle

Community Member, 4 Posts

9 March 2012 at 1:24pm

Hi Optic Blaze,

Yes, using version 0.4.1

I can see that the default date should be set to the current date, however it seems to be overridden and always set to 1 Jan 1970.

Avatar
Optic Blaze

Community Member, 165 Posts

9 March 2012 at 8:29pm

Hi,

The default date is for the Blog is set in the BlogEntry.php file on line 65.
The line reads '$this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));'

Try removing the 'strtotime' parameter so that it now reads: '$this->setField('Date', date('Y-m-d H:i:s'))' then run dev/build and go to the blog and create a new entry.... see if that helps.

Avatar
purtle

Community Member, 4 Posts

10 March 2012 at 4:06pm

Hi Optic Blaze,

Your solution worked great :)

Really appreciate your help!