Date on web pages

They have: 89 posts

Joined: Jul 1999

A while back, I asked someone to help me get the current date on my site. Here is the code they gave me:

<!--begin date-->
<td align="right"><font color="black" face="Verdana,Arial,Helvetica,Geneva" size="1">
<!--#config timefmt="%A, %B %d %Y"-->
<!--#echo var="DATE_LOCAL"-->
</font></td>
<!--end date-->

Since it doesn't give the time, it never dawned on me that it was not EVEN in my time zone. Is there a way to do that? For example, it is only 9:30 p.m. here (CST) but the date on my site has been Feb. 14th for hours now!

Thanks in advance.
Carole

------------------
up to 25% discount on knives, cutlery & sharpeners: Millennium Cutlery

Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.

Enter our Monthly Drawing!!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

It's the local time where your SERVER is, not you.

I don't know how to alter it, maybe with a -howmany hours.

Cheers,

Suzanne

------------------
Zero Cattle
Suzanne
Tables DeMystified

They have: 5,633 posts

Joined: Jan 1970

if you want it to show the day and month that you are currently in, this following code works

code:

<SCRIPT language="JavaScript">
<!--
// Drag the item from the left window and
// drop it here. Or click the right mouse button
// and select 'Insert to Script' from the popup menu.
// The code is inserted at the current
// cursor position.
var now = new Date();
var yr  = now.getYear();
var mn  = now.getMonth() + 1;
var dt  = now.getDate();
var dy  = now.getDay();

var fyr = (yr > 99) ? fyr = yr : 1900 + yr;   // Year 2000 processing

var dys = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var dy = dys[dy];
var mns = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var mn = mns[mn-1];

var msg  = dy + ", " + mn + " " + dt + ", " + fyr;

document.write(msg + " " + "<BR>");

//-->
</SCRIPT>[/code]

it comes up in this format:
Monday, February 14, 2000 
i hope its the one you want!!

------------------
Join The Rest Of The Webmasters On The Net!! 
  
Contact Me:
 [email protected]
 
ICQ: 52790444 

They have: 488 posts

Joined: Feb 2000

Try this script:

<SCRIPT LANGUAGE=Javascript>
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44);
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var monthname =
new Array ("January","February","March","April","May","June","July","August","September","October","November","December" );
document.write(dayname[day] + ", ");
document.write(monthname[month] + " ");

if (date< 10) document.write("0" + date + ", ");
else document.write(date + ", ");
document.write(year + "    <font color=000000>");
document.write("</font>");
</SCRIPT>

Control the color,font size or bold like this:

<FONT COLOR="#FF0000" FACE="ARIAL" SIZE=2 >
<B>
<SCRIPT>
the code
</SCRIPT>
</B>
</FONT>

This script will give the date, month and year on the user's browser when they login to your site.(based on the user's cpu data a.m. or p.m.)

NSS http://www.unitronics.com

[This message has been edited by NSS (edited 14 February 2000).]

[This message has been edited by NSS (edited 14 February 2000).]

[This message has been edited by NSS (edited 14 February 2000).]

They have: 89 posts

Joined: Jul 1999

Thank you all so much. You've been VERY helpful. Glad I came here for this.

Double OK ~ the format is exactly what I want.

I do believe I will go with NSS's script, only because I'd like my customers to feel that it's personalized to their time zone.

Do you think it should show the current time? Of course, I don't have a clue how to do that, but if it's not a LOT more code, do you think it would be beneficial?

In other words, do you have the time on your sites?

thanks again!
Carole

------------------
up to 25% discount on knives, cutlery & sharpeners: Millennium Cutlery

Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.

Enter our Monthly Drawing!!

They have: 488 posts

Joined: Feb 2000

glad the script is of help.The time is on most viewer's browser if they are using win95 is at the bottom right-hand corner and in my opinion it's not needed unless you would want to display two different time.

For more on Javascript, visit: http://javascript.internet.com
You can find lots of scripts of you requirements.

Also please be aware that when you are using Javascript, if the visitor's browser for Javascript is not enable, the visitor will not be able to see it.

NSS http://www.unitronics.com

[This message has been edited by NSS (edited 14 February 2000).]

[This message has been edited by NSS (edited 14 February 2000).]

They have: 89 posts

Joined: Jul 1999

perfect! thanks!

Carole

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.