Date and Time

Date and Time Module for Joomla!

Documentation

Displays the current time and date any way you want it.

Please report any bugs, feature requests, or support requests in the forumsforums.

Download

Be sure to configure the module parameters to your liking.

Changelog

Tip: You can use HTML too! For example:   or   entered in a text box or as a separator will become a space.

If you see strange characters, such as a black diamond with a question mark in it � in the Separators section, don't be alarmed. It is how a space gets saved. Joomla! won't allow you to use a regular space properly by itself so you have to use an HTML entity for it. Unfortunately when it gets loaded back into the module it becomes this strange character: � so it gets converted to a space on output to the front-end of the site.

Information:
Daylight Saving Time / Summer Time: http://en.wikipedia.org/wiki/Daylight_saving_timehttp://en.wikipedia.org/wiki/Daylight_saving_time

Parameters

If you want to use nothing in a parameter where there is something by default you could set it to a blank a tag or span tag for example.

System Output

System output parameters.

Module Class Suffix
A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling.

Caching
Select whether to cache the content of this module

Possible Values:

Use global - will use the cache settings found in the Global Configuration.

No Caching - will not cache output

Cache Time
The time before the module is recached

Compress
You can choose to compress the Javascript output.

Generation Method

Choose where the date and time will come from.

Generation Method
Use PHP or Javascript method to generate date and time - Javascript will generate the date and time using Javascript and will update in realtime.

When using Javascript it will show the date and time to the visitor as it is set on their computer, not the time from the web server, because this uses client-side Javascript.

PHP will generate the date and time using PHP.

When using PHP to generate the time it will show the time of the web server where PHP is installed.

Both will use PHP to get the initial time from the server and then increment that time in realtime using Javascript.

Note that the Time zone offset will affect both Javascript and PHP methods, however when using the PHP method to generate the date and time this is only an offset of hours from the server and does not relate to your time zone.

Possible Values:

Javascript
PHP
Both

Enclosure

HTML or text output for to be displayed immediately before and after the module output.

Pre-text
This is the Text or HTML that is displayed before the module.

Post-text
This is the Text or HTML that is displayed after the module.

Display

Some display settings.

CSS Styles
Enter custom CSS styles here to be applied to the element containing the date and time.

Possible Values:

color:red;
font-weight:bold;
font-size:16px;

Display order of date and time
Which to display first, the date or the time?

Possible Values:

Display Date First
Display Time First

Alignment
The alignment of the date and time.

Possible Values:

None
Left
Center
Right

Show on separate lines or on the same line?
Choose to display the date and time on two separate lines or on the same line.

Possible Values:

Separate lines
Same line

Date

Settings related to date formatting.

Display Date?
Do you wish to display the date?

Possible Values:

Yes
No

Date prefix
Text displayed before the date.

i.e. Date: 02/24/2007

Leave blank to display nothing.

Date suffix
Text displayed after the date.

i.e. 02/24/2007 Date

Leave blank to display nothing.

Display order of date
Order of the parts of the date.

w=day of the week

(Monday, Tuesday, etc.)

d=day of the month

(21st, 22nd, etc.)

m=month

(March, April, etc.)

y=year

(2007, 2008, etc.)

Simply leave a part out if you don't wish to display it.

Example:

Entering [w,d,m,y] will display [Monday, 4th June 2007] but entering only [d,m,y] will display [4th June 2007].

Hint: Don't use the brackets [ ] just the letters and commas.

Use ISO 8601 date format
Disregard most options and output date in ISO 8601 format. (requires PHP5 if using PHP method) For more information see module description above for URL.

Possible Values:

No
Yes

Time

Settings related to time.

Display Time?
Do you wish to display the time?

Possible Values:

Yes
No

Time prefix
Text displayed before the time.

i.e. Time: 4:49pm

Leave blank to display nothing.

Time suffix
Text displayed after the time.

i.e. 05:00 hours

Leave blank to display nothing.

Use profile time zones?
This option will cause the time to change to use the time zone configured in the users profile when they log in.

Use local time zones?

This option will cause the time to change to use the visitor's local time zone. Only works with the JavaScript method of generation.

Javascript time zone offset
Choose the time zone offset to use for Javascript method of generation.

Time zone offset
Time zone offset in hours. Only enter a number of hours here. For example -5 or +3 works fine.When using PHP method this is only an offset of hours from the server and does not relate to your time zone.

Automatic switching of DST / Summer Time
Automatically compensate for Daylight Saving Time / Summer Time. For more information see module description above for URL.

Javascript uses the times below to determine when to adjust the time.

PHP automatically detects this from the server and does not use those dates. You will usually want to shut this off when using PHP method if your server adjusts its time automatically.

Possible Values:

Off
On

DST / Summer Time Adjustment Amount
The number of minutes to adjust DST / Summer Time by.

DST / Summer Time Begins
Daylight Saving Time / Summer Time begins. You can enter any year but the format must match this: [second Sunday of March 2000 02:00] or for Eurpoean: [last Sunday of March 2000 02:00] For more information see module description above for URL.

PHP method automatically detects Daylight Savings Time / Summer Time.

DST / Summer Time Ends
Daylight Saving Time / Summer Time ends. You can enter any year but the format must match this: [first Sunday of November 2000 02:00] or for Eurpoean: [last Sunday of October 2000 02:00] For more information see module description above for URL.

PHP method automatically detects Daylight Savings Time / Summer Time.

Use 24 hour time?
Choose whether to use 24 hour time or not. i.e. 04:30:11 or 19:31:13

Possible Values:

Yes
No

Display hours?
Choose whether to display hours or not.

Possible Values:

Yes
No

Display minutes?
Choose whether to display minutes or not.

Possible Values:

Yes
No

Display seconds?
Choose whether to display seconds or not.

Possible Values:

Yes
No

Show am / pm?
Choose whether to display am/pm or not.

Possible Values:

Yes
No

Text to use for A.M.
Displays this text for A.M.

Text to use for P.M.
Displays this text for P.M.

Separators

Allows you to modify the separators.

Separator to display before the {value}

Displays this text or symbol before the {value}

Separator to display after the {value}
Displays this text or symbol after the {value}

Day of the week output

Allows you to change the week output.

Text to use for {Weekday}
Displays this text for {Weekday}

Month output

Allows you to change the month output.

Display the month as
Text = use parameters below.

Number = 03, 04, 05, etc.

Possible Values:

Text
Number

Text to use for {Month}
Displays this text for {Month}

Day of the month output

Change the output of days of the month.

Display days of the month as
Text = user parameters below.

Number = 1, 2, 3, 4, etc.

Possible Values:

Text
Number

{#day} day of the month
Displays this text for {#day} of the month

Year output

Change the output of the characters in the year.

Display characters in the year as
Text = user parameters below.

Number = 0, 1, 2, 3, 4, etc.

Possible Values:

Text
Number

To change the characters in the year from numbers to something else change the "Display year as" drop down to Text. Then enter the new values in the boxes and the module will replace the numbers with what you enter in the boxes.


Some parts of the code are derived from sites on the internet.

These sites include:
http://www.joomla.org/http://www.joomla.org/
http://php.net/http://php.net/
http://www.yaldex.com/http://www.yaldex.com/
http://www.cs.tut.fi/~jkorpela/iso8601.htmlhttp://www.cs.tut.fi/~jkorpela/iso8601.html
http://www.quirksmode.org/http://www.quirksmode.org/


Thank you to everyone who helps along the way =)