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

Comments

techczech’s picture

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

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

More info here: http://uk.php.net/manual/en/function.date.php
______________________
Dominik Lukes
http://www.dominiklukes.net
http://www.hermeneuticheretic.net
http://www.czechupdate.com
http://www.techwillow.com

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'
format_date($timestamp);

// 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

-Ronan
------------------------------------
Gorton Studios - Websites that Work. http://www.gortonstudios.com/
http://www.gortonstudios.com/portfolio/technologies/drupal

------------------------------------
Ronan
Founder - NodeSquirrel - https://www.nodesquirrel.com/
Agency Tools Lead - Pantheon - https://www.pantheon.io/

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