Change date display format from YY to YYYY

266 views
Skip to first unread message

john.m...@dcalni.gov.uk

unread,
May 30, 2013, 9:57:09 AM5/30/13
to resour...@googlegroups.com
Hi,
 
Am new to Resourcespace and am implimenting a demonstration system for our organisation.
 
We have images relationg to items from early in the last century, and have configured the system to take the item date from the metadata into the date field, but cannot figure where to reconfigure the date display to show the century.
 
Anyone able to point me in the right direction.
 
Thanks,
 
John

john.m...@dcalni.gov.uk

unread,
Jun 17, 2013, 11:56:22 AM6/17/13
to resour...@googlegroups.com

Figured it out myself - if anyone is interested, the date field had value filter which used the nicedate() function which I found in db.php. This was set to return the two digit substring of the year, so I amended it to return the whole year, which is what we need.

Makeda M.

unread,
Jun 19, 2013, 9:56:12 AM6/19/13
to resour...@googlegroups.com
Thanks for posting this - was looking to do the same in our installation.

Sofian Bachiri

unread,
Feb 11, 2015, 5:27:38 PM2/11/15
to resour...@googlegroups.com
Thank you, worked fine for me. If anyone else want to change this, just replace line 747 in includes/db.php with:

    return $d . " " . $m . " " . $y . $t;

Bil Herron

unread,
Feb 12, 2015, 11:13:26 AM2/12/15
to resour...@googlegroups.com
It's not a good idea to edit include/db.php directly because your changes will be overwritten if/when you upgrade your installation. Instead, you can copy

function nicedate() { ... }

from include/db.php and paste it in to your include/config.php file and make any changes there. Now your customized date function won't be wiped out when Resource Space is updated.

Hope that helps!

Bil

Marc B.

unread,
May 31, 2017, 3:30:05 PM5/31/17
to ResourceSpace
I can't seem to get this working. Can you please share the exact code you used in config.php to display four digit year? Thank you.
Reply all
Reply to author
Forward
0 new messages