updatedDate for News Items
2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 12, 2008 (RSS)
By avrom - March 11, 2008
Hi Dave,
I noticed for the date field that the client actually has to manually select the date and time (instead of it being generated automatically - just like a blog).
Can this be replaced with the "updatedDate" or "createdDate" function ? Do these fields need to be added into the Section Editors as a field, or are they just automatically generated ?
Cheers Dude !
Avrom
I noticed for the date field that the client actually has to manually select the date and time (instead of it being generated automatically - just like a blog).
Can this be replaced with the "updatedDate" or "createdDate" function ? Do these fields need to be added into the Section Editors as a field, or are they just automatically generated ?
Cheers Dude !
Avrom
Re: [virgodesign] updatedDate for News Items
By Dave - March 12, 2008
Yes, if you're running v1.10 there's some new "special fields" that you can add (actually they should be automatically added when you upgrade) that do that.
You can use them just like a regular date field and they're called 'createdDate' and 'updatedDate'. Here's some sample code using the PHP date() function to format the date:
You can find the date formatting codes here:
http://www.php.net/date
And more info on special fields here:
http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html
Give it a try and let me know how it goes! :)
Hope that helps!
You can use them just like a regular date field and they're called 'createdDate' and 'updatedDate'. Here's some sample code using the PHP date() function to format the date:
Created: <?php echo date("D, M jS, Y g:i:s a", strtotime($record['createdDate'])) ?><br/>
Updated: <?php echo date("D, M jS, Y g:i:s a", strtotime($record['updatedDate'])) ?><br/>
You can find the date formatting codes here:
http://www.php.net/date
And more info on special fields here:
http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html
Give it a try and let me know how it goes! :)
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com