Thursday, February 22, 2018 04:15 am EST

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 for available options.
Add format.
Go to: /admin/config/regional/date-time
Set medium data type into the desired one.


Anonymous's picture


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

Bri's picture

Not labeled quite right

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