date script ~ revisited
Hi Tiny,
I visited your site and the Date is working fine. It reads as:
Sunday, March 12, 2000 (in Malaysia) where I am. Maybe the other members can confirm whether it's working correctly on their computer's setting.
It could be your computer. If you use Win95, you can test your computer's date by double clicking the time at the bottom right-hand corner and look at the date whether it is correct.
NSS
[This message has been edited by NSS (edited 11 March 2000).]
tiny posted this at 05:30 — 11th March 2000.
They have: 89 posts
Joined: Jul 1999
NSS ~
Thanks for checking. My time and date on my computer are fine. I'm using Win 98 ~ ?
So when you looked, it showed 2000 and not 100? Wonder what my customers see?
Even though I claim to know NOTHING about scripts, I did notice a line or two that I'm wondering about:
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
What do you think? Could that be why mine shows 100?
thanks again
------------------
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!!
NSS posted this at 05:49 — 11th March 2000.
They have: 488 posts
Joined: Feb 2000
Tiny,
Confirm again it reads 2000
Yes change it to:
if (year< 100) year = 2000 + year;
and
g = year % 20;
Should be able to work.
[This message has been edited by NSS (edited 11 March 2000).]
tiny posted this at 15:46 — 11th March 2000.
They have: 89 posts
Joined: Jul 1999
Hi~ I had asked for script at one time to put the current date (for the user) on my site. Either there is some problem with the code, or it was not Y2K compatible, but now the date reads "Saturday, March 11, 100"
Can you help? I know NOTHING about scripts, except maybe how to cut and paste them
Thanks, in advance. Now here's the code I'm using:
<!--begin date-->
<td align="right" width="40%">
<font color="black" face="Verdana,Arial,Helvetica,Geneva" size="1">
<B>
<SCRIPT>
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>
</B>
</font></td>
<!--end date-->
------------------
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!!
tiny posted this at 02:13 — 12th March 2000.
They have: 89 posts
Joined: Jul 1999
NSS ~
I tried that fix, and here is a segment of the code with the two "corrected" pieces:
<SCRIPT>
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year< 100) year = 2000 + year;
cent = parseInt(year/100);
g = year % 20;
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;
When I do View Page Source, of course it doesn't show the script, but it shows the date as March 11, 100 ????
Still stumped (and don't want to look like a moron to my customers....
------------------
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!!
NSS posted this at 04:19 — 12th March 2000.
They have: 488 posts
Joined: Feb 2000
Hi Tiny,
I viewed your code and you have the old setting and your code appeared normal.
In normal cases, when you view the source code of a page, you wont get the date as you mentioned and I am quite puzzle also as you mentioned that you get a blank code.
I would suggest you check the following:
1)Click on Start and select setting
2)From setting, Click on Control panel and select regional setting and set the date to:
Short date: MM/dd/yy
Long date: dddd, MMMM dd, yyyy
Restart your computer and try again. Also view your page in Netscape and IE to confirm the date.
By the way, what html editor are you using?
Hope this helps
NSS
[This message has been edited by NSS (edited 11 March 2000).]
[This message has been edited by NSS (edited 12 March 2000).]
NSS posted this at 05:28 — 12th March 2000.
They have: 488 posts
Joined: Feb 2000
Hi Carole,
I viewed your trial page and the date is working fine in NN and IE using win95/98
The script reads the visitor's computer date and most of the time it will be correct unless they have a bug or corrupted win98 operating system/browser, so not to worry it won't be your fault.
I would suggest that you reinstall updated version of NS and IE since you are having some problems with it.
Your source code is perfect and your knowledge of Tables is very good. I also like the layout and it looks very professional.
I hope you will be able to solve all your problems and good luck.
NSS
Justin S posted this at 05:45 — 12th March 2000.
They have: 2,076 posts
Joined: Jun 1999
It's March 12, 2000 here
------------------
The fireburn.com Network:
Justin Stayton - [email] [icq]
tiny posted this at 15:09 — 12th March 2000.
They have: 89 posts
Joined: Jul 1999
NSS ~
I made the changes in Global Settings as you suggested. Then restarted my computer, and the date is still incorrect in NN. HOWEVER, it IS correct in IE. I had just downloaded the newest version of NN, so I doubt that's the problem (but could be, I guess).
BTW, I had put the new code on this page (as a trial): http://2kcut.com/almar.shtml
So I'm supposed to see the actual script here? That's weird. I believe I have seen it in other places before, esp. when using popup windows.
FYI ~ I use Word to edit my pages, then I FTP them. Is the source code showing up badly or something? That's just the way I learned (and self-taught, at that), so I could be doing it all wrong.
I'm sorry to take up so much of your time, but as I said before, I REALLY don't want to project an image of not knowing what I'm doing [esp. to my customers]. If I could find out WHY it shows up as March 12, 100 I could first FIX it, but also see how many of my customers see it that way.
Thanks SO much for your time.
Carole
Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.
Enter our Monthly Drawing!!
NSS posted this at 18:09 — 12th March 2000.
They have: 488 posts
Joined: Feb 2000
Thanks Justin, Carole will be very happy to read this reply that her script is working fine.
NSS
[This message has been edited by NSS (edited 12 March 2000).]
tiny posted this at 05:44 — 28th March 2000.
They have: 89 posts
Joined: Jul 1999
FYI ~ I found the problem. I had upgraded to Netscape 4.61 and had noticed many problems. I requested a CD from my ISP for the prior version (4.05) and loaded it today.
The date shows perfectly.
If you're curious about the issues I found with 4.61 ~ let me know and I'll enter a new post wherever appropriate.
~ Carole
Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.
Enter our Monthly Drawing!!
Lloyd Hassell posted this at 04:09 — 31st March 2000.
They have: 231 posts
Joined: Feb 2000
I would be interested in your findings about NN4.61. I have found many bugs with NN - well maybe not so much bugs but annoying differences between it and IE.
You should not have to change your browser to support your script - it should be the other way around. If you want a date script I will post one for you.
[This message has been edited by Lloyd Hassell (edited 30 March 2000).]
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
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.