By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Date problem in Opera

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.