473,386 Members | 1,654 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,386 software developers and data experts.

Date problem in Opera

I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.
TIA
MH
remove -bats- to reply
Sep 29 '05 #1
9 1747
On 29/09/2005 12:09, Mike Hyndman wrote:
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.


This was covered two days ago. See:

Who's fault: different displays of date

Date: 2005/09/27 22:44
Author: Dung Ping
Message ID: 11**********************@g44g2000cwa.googlegroups. com

<URL:http://groups.google.co.uk/group/comp.lang.javascript/browse_thread/thread/eff514c740a32ae2/2b7ac24ffecf7308>

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Sep 29 '05 #2
Mike Hyndman wrote:
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.
Don't use getYear(), use getFullYear().

getFullYear() is not supported by very old browsers, you may need to
account for them or at least fail gracefully.

getYear is defined as the current year minus 1900. Why such a value was
thought more useful than the real year is a mystery, but eventually
reason prevailed (no doubt assisted by Y2K issues) and getFullYear was
introduced.

However, some browser developers decided to make getYear report as if it
were getFullYear anyway, making confusion worse rather than better.

TIA
MH
remove -bats- to reply

--
Rob
Sep 29 '05 #3
On Thu, 29 Sep 2005 12:09:59 GMT, Michael Winter
<m.******@blueyonder.co.uk> wrote:
On 29/09/2005 12:09, Mike Hyndman wrote:
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.


This was covered two days ago. See:

Who's fault: different displays of date

Date: 2005/09/27 22:44
Author: Dung Ping
Message ID: 11**********************@g44g2000cwa.googlegroups. com

<URL:http://groups.google.co.uk/group/comp.lang.javascript/browse_thread/thread/eff514c740a32ae2/2b7ac24ffecf7308>

Mike,

My apologies, I must have missed that. When I downloaded the messages
for the first time for this group I only got the last 24 hours.
Many thanks
Mike H

remove -bats- to reply
Sep 29 '05 #4
On Thu, 29 Sep 2005 22:10:52 +1000, RobG <rg***@iinet.net.au> wrote:
Mike Hyndman wrote:
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.


Don't use getYear(), use getFullYear().

getFullYear() is not supported by very old browsers, you may need to
account for them or at least fail gracefully.

getYear is defined as the current year minus 1900. Why such a value was
thought more useful than the real year is a mystery, but eventually
reason prevailed (no doubt assisted by Y2K issues) and getFullYear was
introduced.

However, some browser developers decided to make getYear report as if it
were getFullYear anyway, making confusion worse rather than better.

Rob,

Sorted!
Many thanks
Mike H
remove -bats- to reply
Sep 29 '05 #5
JRS: In article <qi********************************@4ax.com>, dated
Thu, 29 Sep 2005 12:09:00, seen in news:comp.lang.javascript, Mike
Hyndman <mi**@tmphynd-bats-man.demon.co.uk> posted :
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.


Read the newsgroup FAQ, un-maintained as it now is; see below.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Sep 29 '05 #6
Dr John Stockton said the following on 9/29/2005 6:28 PM:
JRS: In article <qi********************************@4ax.com>, dated
Thu, 29 Sep 2005 12:09:00, seen in news:comp.lang.javascript, Mike
Hyndman <mi**@tmphynd-bats-man.demon.co.uk> posted :
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.

Read the newsgroup FAQ, un-maintained as it now is; see below.


The neswgroup FAQ, contrary to your belief, is maintained. If it were
not maintained it wouldn't be available on the web.

Or, do you mean "Not maintained and updated as you would like to see"?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 30 '05 #7
JRS: In article <T8********************@comcast.com>, dated Thu, 29 Sep
2005 21:08:43, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
Dr John Stockton said the following on 9/29/2005 6:28 PM:
JRS: In article <qi********************************@4ax.com>, dated
Thu, 29 Sep 2005 12:09:00, seen in news:comp.lang.javascript, Mike
Hyndman <mi**@tmphynd-bats-man.demon.co.uk> posted :
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.

Read the newsgroup FAQ, un-maintained as it now is; see below.


The neswgroup FAQ, contrary to your belief, is maintained. If it were
not maintained it wouldn't be available on the web.

Or, do you mean "Not maintained and updated as you would like to see"?


Once upon a time, you made only intelligent remarks. Nostalgia rules.

--
© John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Sep 30 '05 #8
Dr John Stockton said the following on 9/30/2005 6:34 PM:
JRS: In article <T8********************@comcast.com>, dated Thu, 29 Sep
2005 21:08:43, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
Dr John Stockton said the following on 9/29/2005 6:28 PM:

JRS: In article <qi********************************@4ax.com>, dated
Thu, 29 Sep 2005 12:09:00, seen in news:comp.lang.javascript, Mike
Hyndman <mi**@tmphynd-bats-man.demon.co.uk> posted :
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.
Read the newsgroup FAQ, un-maintained as it now is; see below.


The neswgroup FAQ, contrary to your belief, is maintained. If it were
not maintained it wouldn't be available on the web.

Or, do you mean "Not maintained and updated as you would like to see"?

Once upon a time, you made only intelligent remarks. Nostalgia rules.


I won't ask how you consider that anything other than an intelligent
question unless you are paranoid. It was, in fact, an intellligent
question with a very good reason for being stated the way it was.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 1 '05 #9
Dr John Stockton wrote:
JRS: In article <T8********************@comcast.com>, dated Thu, 29 Sep
2005 21:08:43, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
Dr John Stockton said the following on 9/29/2005 6:28 PM:

JRS: In article <qi********************************@4ax.com>, dated
Thu, 29 Sep 2005 12:09:00, seen in news:comp.lang.javascript, Mike
Hyndman <mi**@tmphynd-bats-man.demon.co.uk> posted :
I have a small script on a website that that changes the greeting
according to the time of day and displays the current day and date. This
works fine in Internet Explorer, but when viewed in Opera, 2005 displays
as 105.
Any help with this gratefully recieved.
Read the newsgroup FAQ, un-maintained as it now is; see below.


The neswgroup FAQ, contrary to your belief, is maintained. If it were
not maintained it wouldn't be available on the web.

Or, do you mean "Not maintained and updated as you would like to see"?

Once upon a time, you made only intelligent remarks. Nostalgia rules.


If he wasn't a ego-troll before, I think he's becoming one now, given
the insulting and non-helpful attitude I've seen here....

Oct 1 '05 #10

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

Similar topics

4
by: Jo | last post by:
Is there anyway we can know using JavaScript the Short Date Format used in the Control Panel -> Regional and Language Settings? I know the using the combinations of following we can get the...
13
by: Dr John Stockton | last post by:
Javascript date strings can have a one-letter postfix; it is taken as indicating time zone (not J, which causes NaN). // IIRC, VB accepts A & P in that location, for AM & PM. In my MS IE 4, the...
7
by: cc900630 | last post by:
Hi , Anyone have code or can help me write a function to test dates that are : 1) valid dates 2) in the format dd/mm/yy It only needs to work in IE6 and doesnt need to be modified for any...
1
by: FatBoyThin | last post by:
I love it when I back myself into a corner. Seems to be the fastest way to learn. I have 3 tables; tblINBOX, tblOUTBOX and tblPENDING The relevant rows are as following; Date, userID userID is...
9
by: Ed Crowley | last post by:
I have a DateTimePicker control on my form that is displaying the date format in UK format (dd/mm/yy). However, in my code dtpStartDate.Value gives a date in US format, but...
2
by: Robin | last post by:
In an asp.net page that uses a cast function to convert a date, the code works in a development environment but in production it displays the following error. Cast from string "31/03/2005" to...
8
by: hugh webster | last post by:
MySql seems to only accept dates as 'yyyy-mm-dd'. How do I do that when the user might input dd/mm/yy, or d.m.yyyy (I'm in Europe)? I know I can do sscanf, or explode to rebuild the date string -...
34
by: -Lost | last post by:
I'm REALLY liking this so far. And for those who welcome something a little less cryptic than what the resident date guru offers, here's a chance to try something fairly elegant and definitely...
5
by: Dr J R Stockton | last post by:
In Opera 9.2x, new Date.getYear() gives 108. In Opera 9.50, new Date.getYear() gives 2008. AIUI, IIRC, etc., ECMA & ISO/IEC require Year-1900. 9.2x was right, 9.50 agrees with IE 6 & 7. Do we...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.