Display current time on your theme


Warning message

We recommend you to assign at least one category to this snippet so you could easily navigate it in the future. Edit your snippet here.

Get raw version
  1. // in template.php
  2. function yourtheme_preprocess_page(&$vars) {
  3. //you can change format "long" to "medium" or "short"
  4. $vars['current_date'] = format_date(time(),'long');
  5. }
  7. // in your page.tpl.php
  8. print $current_date;