473,231 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

javascript and netscape

The following script works ok for IE, but when someone views it using Netscape
the year shows as 103, is there anything that can be changed in the script to
render it Netscape friendlier please?
Thanks

<SCRIPT language=JavaScript><!--
var DayOfWeek = new
Array('Sunday','Monday','Tuesday','Wednesday','Thu rsday','Friday','Saturday');
var theDate = new Date();
var MonthName = new
Array('January','February','March','April','May',' June','July','August','Septemb
er',
'October','November','December');
document.write('<NOBR>' +
DayOfWeek[theDate.getDay()] + ' ' +
theDate.getDate() + ' ' +
MonthName[theDate.getMonth()] + ', ' +
(theDate.getYear() < 100 ? theDate.getYear() + 1900 :
theDate.getYear()) +
'</font></NOBR>');
//--></SCRIPT>
Jul 20 '05 #1
3 1311
In article <Ht***************@newsfep4-winn.server.ntli.net>, "Brian H供"
<no*****@this.addy.ta> writes:
The following script works ok for IE, but when someone views it using
Netscape
the year shows as 103, is there anything that can be changed in the script to
render it Netscape friendlier please?


Yes. Use getFullYear instead of getYear.
--
Randy
Jul 20 '05 #2
HikksNotAtHome said:
In article <Ht***************@newsfep4-winn.server.ntli.net>, "Brian H供"
<no*****@this.addy.ta> writes:
The following script works ok for IE, but when someone views it using
Netscape
the year shows as 103, is there anything that can be changed in the script to
render it Netscape friendlier please?


Yes. Use getFullYear instead of getYear.


Thank you.
Jul 20 '05 #3
JRS: In article <Ht***************@newsfep4-winn.server.ntli.net>, seen
in news:comp.lang.javascript, Brian H供 <no*****@this.addy.ta> posted at
Sun, 12 Oct 2003 01:44:24 :-
The following script works ok for IE, but when someone views it using Netscape
the year shows as 103, is there anything that can be changed in the script to
render it Netscape friendlier please?


Method getFullYear is available in most browsers; but all you need to do
is to change 100 to 1000 or 1e3.

When posting code, do not allow your news software to line-wrap it; that
is inconsiderate towards possible readers.

Telling your readers the current local date is rather pointless and a
waste of resources; they can discover it in many other ways.

Read the FAQ.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you抣l learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.