473,623 Members | 3,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1758
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************* *********@g44g2 00...legr oups.com

<URL:http://groups.google.c o.uk/group/comp.lang.javas cript/browse_thread/thread/eff514c740a32ae 2/2b7ac24ffecf730 8>

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.******@bluey onder.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************* *********@g44g2 00...legr oups.com

<URL:http://groups.google.c o.uk/group/comp.lang.javas cript/browse_thread/thread/eff514c740a32ae 2/2b7ac24ffecf730 8>

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.ne t.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.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.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.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 30 '05 #7
JRS: In article <T8************ ********@comcas t.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.demo n.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demo n.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************ ********@comcas t.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.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 1 '05 #9
Dr John Stockton wrote:
JRS: In article <T8************ ********@comcas t.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
19801
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 Locale Long Name format toString() toLocaleString() toLocaleDateString()
13
2221
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 object generated by new Date("2001/1/1 0:0:0R") has value meaning Sun Dec 31 19:00:00 UTC 2000. That combination of local time and UTC corresponds, AIUI, to Tashkent and Karachi, in Asia (and not to any US towns of the...
7
2906
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 other date formats.
1
1588
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 a 5 digit number I understand how to construct a query to return a count of the userID for a date range for a single table. I'm stumped on how to get a single query that will give me the count of the userID for a date range.
9
5036
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 dtpStartDate.Value.ToString() gives the date in the required UK format! Any ideas? All system locale settings are set to British/UK settings.
2
1652
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 type 'Date' is not valid. Both are Windows 2003 servers I have check the regional settings which are both English (United Kingdom). Are there any other settings that I need to check?
8
1683
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 - but there must be a better way. Is there a FAQ somwhere? tks. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
34
2505
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 unique. http://www.datejs.com/ -- -Lost Remove the extra words to reply by e-mail. Don't e-mail me. I am kidding. No I am not.
5
1035
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 agree? Anything else interesting noticed? -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Web <URL:http://www.merlyn.demon.co.uk/- w. FAQish topics, links, acronyms
0
8221
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8662
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8603
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6104
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5560
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4067
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2593
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.