$today = date("j");
$todaytip = Array(
"tip 0",
"A Look At Lists",
"Accessibility - A New way Of Thinking",
"Headline Syndication",
"Planning Your Site",
"Meta Tag Generator",
"Regular Expression Tester",
"Is Your Browser Up To Date?",
"Assume Nothing Test Everything",
"Javascript Date And Time",
"Easy Maintenance With Server Side Includes ",
"Quick Tips",
"Accessible Web Forms",
"Building A Webpage",
"Sensible File Structure",
"Update Your RSS Newsfeed",
"Test Your Site",
"Set Up A Home Development Server",
"Add To Favorites How To",
"Beat The Spam Bots",
"Create Placeholder Text",
"Forms With Style",
"Date And Time Using SSI",
"PHP Jump Menu",
"A Guide to Web Forms",
"Mouseovers Without Javascript",
"Beginners Tips",
"Navigation Tips",
"Javascript Alert Guide",
"CSS Guide",
"PHP Page Protect",
"Close Your Tags"
);
$todaylink = Array(
"link 0",
"http://webdevtips.andyholtonline.co.uk/webdevtips/html/lists/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/html/accessibility/overview.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/rss/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/planning.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/codegen/metatag.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/resources/regex.php",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/browsers.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/ante.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/js/datetime.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/ssi/include.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/tips.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/html/accessibility/forms.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/basics/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/structure.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/codegen/rss_update.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/windows/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/serverstuff/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/js/addtofavorites.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/codegen/email_scramble.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/codegen/ipsum.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/style/forms.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/ssi/time.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/php/jump.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/html/forms/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/style/rollover.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/newbiehelp.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/developer/bad_nav.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/js/alert/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/style/guide/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/php/secure/index.shtml",
"http://webdevtips.andyholtonline.co.uk/webdevtips/html/whyclose.shtml"
);
print "
WebDevTips Pick Of The Day : ".$todaytip[$today]." |";
?>
You are here : Home - Web Development - Includes - Date & Time
Date & Time

There are several ways of putting the current date and time onto a webpage. Putting the the date and time on a webpage just for the sake of it can be pretty pointless but when used in the right context can add value.
Here are a few examples. There is a table of date and time formatting switches at the end.
The current local time :
<!--#echo var="DATE_LOCAL" -->
displays : Saturday, 16-Feb-2019 06:53:18 GMT
|
The current time (GMT) :
<!--#echo var="DATE_GMT" -->
displays : Saturday, 16-Feb-2019 06:53:18 GMT
|
The current time (dd/mm/yy) :
<!--#config timefmt="%d/%m/%y" -->
<!--#echo var="DATE_LOCAL" -->
displays : 16/02/19
|
The current time (Day dd Month yyyy) :
<!--#config timefmt="%a %d %h %Y" -->
<!--#echo var="DATE_LOCAL" -->
displays : Sat 16 Feb 2019
|
As you can see from the small examples above, there are lots of ways to configure the output of you date. Using any combination of codes in the <!--#config timefmt="CODES" --> line you can pretty much format the output anyway you wish.
code |
Description |
%a |
abbreviated weekday name |
%A |
full weekday name |
%b |
abbreviated month name |
%B |
full month name |
%c |
locale's appropriate date and time |
%C |
default date and time format |
%d |
day of month - 01 to 31 |
%D |
date as %m/%d/%y |
%e |
day of month - 1
to 31 |
%h |
abbreviated month name (alias for %b) |
%H |
hour - 00 to 23 |
%I |
hour - 01 to 12 |
%j |
day of year - 001 to 366 |
%m |
month of year - 01 to 12 |
%M |
minute - 00 to 59 |
%n |
insert a new line character |
%p |
string containing AM or PM |
%r |
time as %I:%M:%S %p |
%R |
time as %H:%M |
%S |
second - 00 to 61 |
%t |
insert a tab character |
%T |
time as %H:%M:%S |
%U |
week number of year - 00 to 53 |
%w |
day of week - Sunday=0 |
%W |
week number of year - 00 to 53 |
%x |
Country-specific date format |
%X |
Country-specific time format |
%y |
2 digit year - YY |
%Y |
4 digit year - YYYY |
%Z |
timezone name |