navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Automatic dates

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Automatic dates
Page: [1]
 
cesar

 

Posts: 2
Joined: 6/5/2003
Status: offline

 
Automatic dates - 7/3/2003 10:49:35   
I wish to include the day, month and year at the top of a website. It must change completely automatic every time somebody checks upon these pages. Any help?
I thank you all in advance for you troubles and time.
:)
Gil

 

Posts: 7533
From: North Carolina, USA
Status: offline

 
RE: Automatic dates - 7/3/2003 11:00:51   
What date/time - server or visitor?

_____________________________

Gil Harvey, 1947-2004

(in reply to cesar)
abbeyvet

 

Posts: 5095
From: Kilkenny Ireland
Status: offline

 
RE: Automatic dates - 7/3/2003 11:21:57   
f it is visitor time, I like this way, though there are shorter scripts. Shows it in this format:

Thursday, 3 July 2003

    <script language=" JavaScript" >
        <!-- Hide the script
       var today=new Date();	
        
        var months=new Array(13);
        months[1]=" January" ;
        months[2]=" February" ;
        months[3]=" March" ;
        months[4]=" April" ;
        months[5]=" May" ;
        months[6]=" June" ;
        months[7]=" July" ;
        months[8]=" August" ;
        months[9]=" September" ;
        months[10]=" October" ;
        months[11]=" November" ;
        months[12]=" December" ;      

        var lmonth=months[today.getMonth() + 1];
        var date=today.getDate();
        var year=today.getFullYear();
        var dayno = today.getDay() + 1;

        if(dayno==1) day = " Sunday" ;
        if(dayno==2) day = " Monday" ;
        if(dayno==3) day = " Tuesday" ;
        if(dayno==4) day = " Wednesday" ;
        if(dayno==5) day = " Thursday" ;
        if(dayno==6) day = " Friday" ;
        if(dayno==7) day = " Saturday" ;

         var thedate= (day + " , "  + date + "  "  + lmonth + "  "  + year);


        document.write(thedate);
        // end hiding-->
        </script>


You could just use this, but it is not so pretty and includes the time:

Thu Jul 03 16:06:36 2003

<SCRIPT>
document.write(Date())
</SCRIPT>


Or you can get more elaborate and have this:

Good afternoon, it is Thursday, 3 July 2003


 <script language=" JavaScript" >
        <!-- Hide the script
		var today=new Date();	
        
        var months=new Array(13);
        months[1]=" January" ;
        months[2]=" February" ;
        months[3]=" March" ;
        months[4]=" April" ;
        months[5]=" May" ;
        months[6]=" June" ;
        months[7]=" July" ;
        months[8]=" August" ;
        months[9]=" September" ;
        months[10]=" October" ;
        months[11]=" November" ;
        months[12]=" December" ;      

        var lmonth=months[today.getMonth() + 1];
        var date=today.getDate();
        var year=today.getFullYear();
        var dayno = today.getDay() + 1;

        if(dayno==1) day = " Sunday" ;
        if(dayno==2) day = " Monday" ;
        if(dayno==3) day = " Tuesday" ;
        if(dayno==4) day = " Wednesday" ;
        if(dayno==5) day = " Thursday" ;
        if(dayno==6) day = " Friday" ;
        if(dayno==7) day = " Saturday" ;
        
        hr = today.getHours();
		if ((hr >= 1) && (hr <=5)) {
   		t = " Good morning, it is " ;}
		if ((hr >= 6) && (hr <=11)) {
   		t = " Good morning, it is " ;}
		if ((hr >= 12) && (hr <=16)) {
   		t = " Good afternoon, it is " ;}
		if ((hr >= 17) && (hr <=21)) {
   		t = " Good evening, it is " ;}
		if ((hr == 22) || (hr ==23)) {
   		t = " Good evening, it is " ;}
		if (hr==0) {
   		t = " Good night" ;}

        var thedate= (t + day + " , "  + date + "  "  + lmonth + "  "  + year);


        document.write(thedate);
        // end hiding-->
        </script>



You can also do it with SSI rather than JavaScript if you are on a Unix platform, or with ASP on Windows.



To use any of those just paste the scripts into the page (in HTML view) whereever you want the date to appear.

< Message edited by abbeyvet -- 7/3/2003 11:28:08 AM >


_____________________________

Katherine

:: InKK Design :: InKK Domains

(in reply to cesar)
paperfish

 

Posts: 181
From: None
Status: offline

 
RE: Automatic dates - 7/4/2003 7:53:34   
For server time, I like to use SSI. This example below shows both the today' s date and the date the page was last revised:

<!--#config timefmt=" %B %d, %Y" -->
<table border=" 0" cellpadding=" 0" cellspacing=" 0" width=" 100%" >
<tr>
<td width=" 50%" align=" center" >
<p class=" SOPIntror1c1" >Today is: <!--#echo var=" DATE_LOCAL" -->
</p>
</td>
<td width=" 50%" align=" center" >
<p class=" SEPDate" >Date Last Revised: <!--#echo var=" LAST_MODIFIED" -->
</p>
</td>
</tr>
</table>

You can customize the date display by changing the parameters for " config timefmt"

(in reply to cesar)
Larry M.

 

Posts: 2834
Joined: 2/20/2003
From: Greenville, South Carolina, USA
Status: offline

 
RE: Automatic dates - 7/13/2003 13:22:26   
quote:

You can also do it with SSI rather than JavaScript if you are on a Unix platform


Katherine,

My sites are hosted on Unix Servers and I' ve been using time/date scripts for some time. I am, however, interested in learning about SSI, so: (1) what are the advantages to using SSI and (2) using the time/date script as an example, how is this accomplished in FP2002? :)

Thanks!

_____________________________

Larry M.

Reality is the leading cause of stress among those few in touch with it

(in reply to cesar)
Gil

 

Posts: 7533
From: North Carolina, USA
Status: offline

 
RE: Automatic dates - 7/13/2003 13:28:19   
quote:

(1) what are the advantages to using SSI and

(2) using the time/date script as an example, how is this accomplished in FP2002?


Hi Larry,

(1) Less code blaot for one thing :)

(2) Just add a line of code wherever you want the time:
<!--#echo var=" DATE_LOCAL" -->

_____________________________

Gil Harvey, 1947-2004

(in reply to Larry M.)
gorilla

 

Posts: 2974
From: Denmark
Status: offline

 
RE: Automatic dates - 7/13/2003 13:42:08   
Hi Larry M,

I' ll start by saying " Poot! Pipped at the post by Gil again!" :).

Less code bloat is indeed a very good reason to use SSI.

If you go to www.bignosebird.com you' ll find a superb bunch of tutorials including some on SSI.

Here' s a direct link to the SSI tutorials

http://www.bignosebird.com/ssi.shtml

(but do check out the other one' s) between the BNB tutorials and the ones here on outfront you' ll find a wealth of very easily done things to add a little extra sparkle to your site.



Freya
Great matriarch and puissant panjandurum of the silverback gorilla tribe.

Thought for the day: " An alpha female equipped with the keys to a banana plantation and a rolling pin commands instant respect and deference."

Copenhagen
Denmark
July 13th 2003

< Message edited by gorilla -- 7/13/2003 2:30:46 PM >


_____________________________

Mháircaish

Signature self-censored to protect the sensibilities of the thin-skinned :).

May we never confuse honest dissent with disloyal subversion. – Dwight D. Eisenhower



(in reply to cesar)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Automatic dates
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts