How do you convert the integer date inside the created and changed fields so that I can create a regular date?


techczech’s picture

You can try the PHP date() function. This is the code I use to theme my Event nodes:

echo date("D, j M, Y \a\\t G:i", $event_start) ?>

More info here:
Dominik Lukes

MikeInator’s picture

Great, really appreciated.

MikeInator, the webinator.

ronan’s picture

You can also use the drupal function format_date()
This function will respect the timezone setting for the site and allows you to specify one of the standard drupal date formats or your own custom format:

// to use the standard drupal date format 'medium'

// to use a different drupal date such as 'small' or 'large'
format_date($timestamp, 'small');
format_date($timestamp, 'large');

// to use a custom format
format_date($timestamp, 'custom', 'D, j M, Y \a\\t G:i' );

the custom type takes the same format rules as the php date function and the standard formats can be changed at /admin/settings

Gorton Studios - Websites that Work.

Founder - NodeSquirrel -
Agency Tools Lead - Pantheon -

MikeInator’s picture

Greatly appreciated.

MikeInator, the webinator.

MikeInator’s picture

What file is it in?

MikeInator, the webinator.

alextronic’s picture

thank you so much.

weseze’s picture

For Drupal 6 the format_date() function also localizes the date.
Don't know if it is true for Drupal 4...

candelas’s picture

@ronan sometimes i am tired and dont have more neurones... just to search.
and i found you :)

//trying to answer one question for each one that i make.
//this way, drupal will be more friendly and strong