Sunday, April 30, 2017 06:46 am EDT

Change the submitted variable in drupal 7

Bri's picture

Go to: /admin/config/regional/date-time/formats/add
Create desired time format, i.e. l, d/m/Y or see http://id.php.net/manual/en/function.date.php for available options.
Add format.
Go to: /admin/config/regional/date-time
Set medium data type into the desired one.

Comments

Anonymous's picture

hi

whats that all about?
care to explain?
just thought i would ask
:)

Bri's picture

Not labeled quite right

Hello,
I guess i didn't really title the article quite correct. It is really about changing the date format that is used in the $submitted variable. The date format can be changed, or new ones can be added using the method above.
If you really do want to change the $submitted variable, you can do so with a preprocess function. Something like...

function myTHEME_preprocess_node(&$variables) {
  
  if($variables['type'] == '[content_type]') {
    $variables['submitted'] = 'some new value';
  }
}