We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

date format | Forum

Topic location: Forum home » Support » General Questions
brindy
brindy Jul 6 '12
Is there any way to set the date format for the site?  


I need to use UK date format (Day Month, Year) and show the day.  For example:


Current:Jul 6, 2012

Should be: Fri, 6 Jul, 2012


Thanks in advance!


brindy
brindy Jul 6 '12
OK, I found it ... I edited ow_utilities/date_time.php and changed the formatSimpleDate function as follows:


// $month = $language->text('base', 'date_time_month_short_' . date('n', $timeStamp));

// $at = $language->text('base', 'date_time_at_label');

if ( $onlyDate )
{
return ( date('y', $timeStamp) === date('y', time()) ) ?
strftime("%a, %e %b", $timeStamp) :
strftime("%a, %e %b '%y", $timeStamp);
}

return ( date('y', $timeStamp) === date('y', time()) ) ?
( $militaryTime ? strftime("%a, %e %b, %H:%M", $timeStamp) : strftime("%a, %e %b, %I:%M%p", $timeStamp) ) :
( $militaryTime ? strftime("%a, %e %b '%y, %H:%M", $timeStamp) : strftime("%a, %e %b '%y, %I:%M%p", $timeStamp) );