Wednesday, June 28, 2017 05:03 pm 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

Drupal is the common website

Drupal is the common website platform and the number of people is like this because everything is easily available and we can also modify our website according to requirements. Those essayuniverse.net reviews about version 7 would be pretty useful for the users.

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';
  }
}