Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By courtney on
hi,
i'm trying to customize my theme to display just the date on entries, and not include the time. it looks like i'll have to customize the format_date function in the common.inc file, but i'm not sure exactly how to do it. has anyone done this before?
thanks,
courtney
Comments
how to not display time?
hi,
still trying to figure this out and thought i would check back...also seems like something that should be configureable. should i submit an issue/request?
courtney
custom dates
courtney,
in custom.inc, format_date() also takes a 'custom' argument as one of the parameters. to have just the date, you would call format_date with something like the following:
the m/d/Y would give you the month/day/year for the specified timestamp. if you would like to use other fields, check out the PHP manual page for the date function, which gives a table for other fields you might want to use, such as day name, etc. that URL is: http://us3.php.net/manual/en/function.date.php.
hope that helps!
jeremy - the linux web guy
date without time!
how simple, and it works!! thank you! :)
Thank you very helpful
Thanks that was quite a helpful bit of info
How to display time without date?
how to display from and to(end) time without date ?