Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How to Set Date Format

Submitted by on November 22, 2010 – 8:54 amNo Comment

This article will tell you how to change the standard date output in templates files (*.tpl.php) of a theme.

Solutions:

  • Select one of the standard date & time formats on the “Date and time” settings page.
  • Use format_date() function
  • Select one of the standard date & time formats on the “Date and time” settings page.

    • Drupal 6: admin/settings/date-time
    • Drupal 5: admin/settings/date-time

    Use format_date() function

    You can use format_date() Drupal function to set the date format. This function takes account of time zone settings of your site and allows you to set one of the standard formats or create a new one.:

    // use ‘medium’ standard Drupal date format
    format_date($timestamp);

    // use other drupal date format, for example ‘small’ or ‘large’
    format_date($timestamp, ‘small’);
    format_date($timestamp, ‘large’);

    // use optional date format
    format_date($timestamp, ‘custom’, ‘D, j M, Y \a\\t G:i’ );

    Optional format has the same arguments as PHP function date() has. You can change the standard formats through administer (/admin/settings)

    Leave a comment!

    Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

    Be nice. Keep it clean. Stay on topic. No spam.

    You can use these tags:
    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.