Date and Time
Date and Time Module for Joomla!
Displays the current time and date any way you want it.
Please report any bugs, feature requests, or support requests in the forums.
Be sure to configure the module parameters to your liking.
Tip: You can use html too! For example: entered in a text box or as a separator will become a space.
Note that if you see funny symbols entered it is because that is a space and for some reason
Documentation
Daylight Saving Time / Summer Time: http://en.wikipedia.org/wiki/Daylight_saving_time
ISO 8601 Format: http://en.wikipedia.org/wiki/ISO_8601
Parameters
Module Class Suffix
A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling.
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.
Alignment
The alignment of the date and time.
Possible Values:
None
Left
Center
Right
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.
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
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 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.
Display order of date and time
Which to display first, the date or the time?
Possible Values:
Display Date First
Display Time First
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
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 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 Begins
Date and time Daylight Saving Time / Summer Time begins. You can enter any year but the format must match this exactly: [March 14, 1999 2:59:59] For more information see module description above for URL.
PHP method automatically detects Daylight Savings Time / Summer Time.
DST / Summer Time Ends
Date and time Daylight Saving Time / Summer Time ends. You can enter any year but the format must match this exactly: [November 7, 1999 2:59:59] 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.
Separator to display before the day of the week
Displays this text or symbol before the day of the week
Text to use for {Weekday}
Displays this text for {Weekday}
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}
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
Some parts of the code were taken or derived from sites on the internet.
These sites include:
http://www.joomla.org/
http://php.net/
http://www.yaldex.com/
http://www.cs.tut.fi/~jkorpela/iso8601.html
http://www.quirksmode.org/
I also want to thank everyone who helps along the way =)
Changelog
2.1.8 - 21 Nov 2009
Fixed bug with the order of the code. Thanks to moderntalking on the forums!
2.1.7 - 29 Sept 2009
Fixed error when trying to show only the date
Removed another PHP notice - thanks to jonusc
2.1.6 - 25 Aug 2009
I released the wrong files early this morning because apparently it didn't work properly in every case, sorry!
Removed PHP notices
2.1.5 - 11 June 2009
Fixed spaces turning into weird symbols - will still save in the params as weird symbols but will be replaced by a space on output
Added support for multiple instances of the module
2.1.4 - 3 April 2009
Fixed time zone issue where a positive value entered would work as a negative value
Now requires Joomla 1.5
2.1.3 - 31st May 2008
31st day now shows correctly
2.1.2
Fixed bug where it would show am/pm opposite at the 11th hour
2.1.1
Fixed bug where it would show blank day on 10th of each month
2.1
Fixed some bugs with time zones
Added ability to change Daylight Savings Time / Summer Time
Added ability to use ISO 8601 date format.
Added language support for days of the month.
Added alignment.
2.0
Added tons of features.
No longer uses Joomla function to get the date.