Is it possible to show the time and date

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
nauticalwebd

Is it possible to show the time and date

Post by nauticalwebd »

I know with standard website design you can use SSI to show the server time and date on your website.  Is there a way to do this through CMS?  So far everything i've tried has failed.
cyberman

Re: Is it possible to show the time and date

Post by cyberman »

Please look at Extensions > Tags in admin panel. There's a tag named current_date which can do what you want :).
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Is it possible to show the time and date

Post by calguy1000 »

Also, the CustomContent module can be used for this.  It can also be used to display different content based on the time and date.  The list of variables that CustomContent exports is now greatly expanded, and should be very useful for you.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
nauticalwebd

Re: Is it possible to show the time and date

Post by nauticalwebd »

both work great, but i didn't realize till now that my server is in a different timezone than i'm wanting displayed on my website.  Is there some way to modify this to move the time up 1 hour for my time zone?
cyberman

Re: Is it possible to show the time and date

Post by cyberman »

Have you tried to call date_default_timezone_set() in index.php?

http://www.dynamicwebpages.de/php/funct ... ne-set.php
nauticalwebd

Re: Is it possible to show the time and date

Post by nauticalwebd »

cyberman wrote: Have you tried to call date_default_timezone_set() in index.php?

http://www.dynamicwebpages.de/php/funct ... ne-set.php

I have tried this but have been un-successfull.  Where would the code go?  I'm not too familiar with php so i'll strugle a little bit.  Here is what I have tried putting into the index.php file.  Either I received (Call to undefined function: date_default_timezone_set()) or the page pulled up fine but the time did not change.

echo(date_default_timezone_set("Europe/Paris"));
alby

Re: Is it possible to show the time and date

Post by alby »

nauticalwebd wrote:
cyberman wrote: Have you tried to call date_default_timezone_set() in index.php?

http://www.dynamicwebpages.de/php/funct ... ne-set.php

I have tried this but have been un-successfull.  Where would the code go?  I'm not too familiar with php so i'll strugle a little bit.  Here is what I have tried putting into the index.php file.  Either I received (Call to undefined function: date_default_timezone_set()) or the page pulled up fine but the time did not change.

echo(date_default_timezone_set("Europe/Paris"));
date-default-timezone-set is valid for php >= 5.1 version
Top for User Contributed Notes in date function there is a useful function

Alby
Locked

Return to “Layout and Design (CSS & HTML)”