473,224 Members | 1,607 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,224 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 1742
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
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...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
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: 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"....

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.