Hi!

I have modified a theme to include the current date.
I use the php getdate() function.

Everything works fine, but it's really annoying that sometimes I see the last day instead of today.
This is because Drupal has cached the page (I have normal caching enabled).

How can I force Drupal to recalculate the day every new day.
I still would like to use tha caching feature.

Thanks.

Here is my PHP code:


$_date = getdate();

echo "<div id=\"date\">".$_date[year].". ".$_date[mon]." ".$_date[mday]."</div>";

Thanks.

Comments

matt v.’s picture

I haven't tried this, but it looks like you might be able to create a custom module that uses hook_cron to periodically call cache_clear_all.