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.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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.
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.
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.
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.
Hi Optic Blaze,
Your solution worked great :)
Really appreciate your help!