Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Most compact way to display todays date on a page? (http://www.greenguysboard.com/board/showthread.php?t=11042)

Bill 2004-09-12 01:20 AM

Most compact way to display todays date on a page?
 
The topic pretty much says it - I'm looking for the most compact scripting to display todays date on a page.

The javascript stuff seems pretty bulky, is there some way to do it that doesn't take multiple lines of script?

Wazza 2004-09-12 02:09 AM

http://www.ssi-developer.net/ssi/ssi-date.shtml :D

Ramster 2004-09-12 08:13 AM

That'll pretty well do it. :)

AcidMaX 2004-09-13 08:18 AM

Or for PHP you can use something like


Bill 2004-09-13 03:14 PM

Two beautiful methods, thanks much Wazza and Acidmax!

I'm a little more familiar with ssi than php, is there anything special that I have to do to get the php method to display on an html page?

(I know that to use the ssi method I have to insert the entries into htaccess to get ssi to display on an html page. I'm guessing there's a similar htaccess entry for php...)

AcidMaX 2004-09-13 03:27 PM

If php is installed on your webserver (it is on the majority out there). Just save the file with a .php extension and put that code where you want the date and you are all set.

Andy

Opti 2004-09-28 08:57 AM

Quote:

Originally posted by Bill
Two beautiful methods, thanks much Wazza and Acidmax!

I'm a little more familiar with ssi than php, is there anything special that I have to do to get the php method to display on an html page?

(I know that to use the ssi method I have to insert the entries into htaccess to get ssi to display on an html page. I'm guessing there's a similar htaccess entry for php...)

this line in .htaccess will make all .html pages be parsed for php

AddType application/x-httpd-php html

or you can force for a particular file like this


ForceType application/x-httpd-php


All times are GMT -4. The time now is 06:00 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc