PHP Diary | PHP Housekeeping | PHP Scripts | TD Scripts.com
12/17/99
"Inserting Dates"
[goto next diary entry]
One of the first things I'd like to be able to do in PHP is not have to worry about typing the current server date and time every time I login and update these pages for you. You might wonder why I would update diary pages, well, I will write the original outline on the days that work on things, but later on there will probably be things I'd like to come back and add into the listings for consistency or for design purposes. I would like to provide some type of date stamp for when I add these updates later on. I know how to do this using Server Side Includes (http://www.tdscripts.com/ssi.html), but I decided I'd like to be able to do this in PHP. I already downloaded the PHP instruction manual off the main site at
reference http://www.php.net/docs.php3 or the faster (well,
at least from my location)
(mirror) http://php.he.net/docs.php3
This is the manual description of the date command:
string date
(string format, int [timestamp]
);
This may look like greek to you, but this is common in user manuals if you aren't familiar with them. The PHP code to print the current server date to the browser uses the date command.
<? print(date("1 F d, Y")); ?>
All those letters in the parenthesis are similar to the SSI date codes. Below are these codes straight out of the PHP download user manual for reference:
The following characters are recognized in the format string:
12/17/99
"Inserting Dates"
[goto next diary entry]
PHP Diary | PHP Housekeeping | PHP Scripts | TD Scripts.com
Copyright 2000 php-scripts.com