JREF Homepage Swift Blog Events Calendar $1 Million Paranormal Challenge The Amaz!ng Meeting Useful Links Support Us
James Randi Educational Foundation JREF Forum
Forum Index Register Members List Events Mark Forums Read Help

Go Back   JREF Forum » General Topics » Computers and the Internet
Click Here To Donate

Notices


Welcome to the JREF Forum, where we discuss skepticism, critical thinking, the paranormal and science in a friendly but lively way. You are currently viewing the forum as a guest, which means you are missing out on discussing matters that are of interest to you. Please consider registering so you can gain full use of the forum features and interact with other Members. Registration is simple, fast and free! Click here to register today.

Tags firefox

Reply
Old 26th July 2006, 07:14 AM   #1
Upchurch
Papa Funkosophy
 
Upchurch's Avatar
 
Join Date: May 2002
Location: Funky Town (STL, MO)
Posts: 23,428
Riddle me this, Firefox...

Using Firefox 1.5, I've come across an unusual error. On our live site, everything works fine, but when I view our development site (which is supposed to be nearly identical, I get an SQL error due to the fact that it is reading the date as dd/mm/yyyy instead of mm/dd/yyyy. Both sites work fine in ID, it's just devl site on Firefox.

Now I've scanned through my settings. The only extensions I have for Firefox is Google Toolbar, IE Tab, and Tab Mix Plus. The page in question gives slightly different results when viewed as Firefox or IE in Firefox, but the root cause of the error seems to be the date format.

Now, what might be causing Firefox to confuse date formats in this one case and not others?
Upchurch is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 26th July 2006, 10:20 AM   #2
Cleon
King of the
Pod People
Moderator
 
Cleon's Avatar
 
Join Date: Aug 2001
Location: Atlanta, GA
Posts: 20,535
SQL error? Could you be a bit more specific about what the page is doing?

I'm in the middle of coding a struts-based reporting app, so right now I am The Man when it comes to date formats.
__________________
"People like me are what stand between us and Auschwitz." - Newt Gingrich
Cleon is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 26th July 2006, 10:32 AM   #3
Upchurch
Papa Funkosophy
 
Upchurch's Avatar
 
Join Date: May 2002
Location: Funky Town (STL, MO)
Posts: 23,428
Code:
-2147217913 
   
  The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. 
   
  SQL:SELECT TOP 2 UID, AdUnitPage, AdType, PI FROM AdContent WHERE AdUnitSize='728X90' and datestart<='26/07/2006' and datestop>='26/07/2006' and datestop>='26/07/2006' and available>0 order by LastViewed;
Our asp provides this data when it encounters this kind of problem. Note the date format.

I reset all Firefox preferences and it seems to be working again. I don't know which one made the difference.
Upchurch is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 26th July 2006, 10:56 AM   #4
El_Spectre
Lizard Scum
 
El_Spectre's Avatar
 
Join Date: Jan 2005
Location: Arizona Bay
Posts: 1,206
Sounds like the app is feeding a client side - and thus untrustworthy - date into the proc...
__________________
Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel. - Ambrose Bierce

Question your argument if you must mock your opponent to make it...

Step 1 in helping spread the skeptical way of thinking: Don't be a jerk.
El_Spectre is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 26th July 2006, 03:34 PM   #5
Cleon
King of the
Pod People
Moderator
 
Cleon's Avatar
 
Join Date: Aug 2001
Location: Atlanta, GA
Posts: 20,535
What ES said. I encourage you to rethink the structure of this app.
__________________
"People like me are what stand between us and Auschwitz." - Newt Gingrich
Cleon is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 27th July 2006, 09:00 AM   #6
Ripley Twenty-Nine
Muse
 
Ripley Twenty-Nine's Avatar
 
Join Date: May 2005
Location: London, Ontario
Posts: 867
Originally Posted by Cleon View Post
What ES said. I encourage you to rethink the structure of this app.
Especially considering if it's using the client's Date format, it might be using the client's timestamp as well. Pretty scary considering how far off most people's computers are!
__________________
Ripley 29

"Professor, without knowing precisely what the danger is, would you say it's time for our viewers to crack each other's heads open and feast on the goo inside?"
"Yes I would, Kent."
Ripley Twenty-Nine is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 27th July 2006, 09:18 AM   #7
Upchurch
Papa Funkosophy
 
Upchurch's Avatar
 
Join Date: May 2002
Location: Funky Town (STL, MO)
Posts: 23,428
Many revisions planned, but we have to support the current system until that point. You know how it goes.
Upchurch is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 27th July 2006, 09:31 AM   #8
Cleon
King of the
Pod People
Moderator
 
Cleon's Avatar
 
Join Date: Aug 2001
Location: Atlanta, GA
Posts: 20,535
Originally Posted by Upchurch View Post
Many revisions planned, but we have to support the current system until that point. You know how it goes.
It just screams security problems, but at this point what I would do is run a Javascript function to force a format of the date.

For example, if you absolutely, positively, need a MM/DD/YYYY format, do something like this:

Code:
function formatNumber(i) {
	if(i< 10) {
		return("0" + i);
	}
	else {
		return(i);
	}
}

function formatDate() {
	var today = new Date();
	var day = today.getDate();
	var month = today.getMonth() + 1; // Month is 0-based
	var year = today.getYear();
	
	// Some clients do "year" as years since 1900, eg 106
	if(year < 1000) { 
		year += 1900;
	}
	
	var str = formatNumber(month) + "/" + formatNumber(day) + "/" + year;
	return(str);
}
ETA: And for the love of Jebus, redevelop that app!!!!
__________________
"People like me are what stand between us and Auschwitz." - Newt Gingrich
Cleon is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 29th July 2006, 04:10 PM   #9
Soapy Sam
NLH
 
Join Date: Oct 2002
Posts: 25,885
Originally Posted by Upchurch View Post
Many revisions planned, but we have to support the current system until that point. You know how it goes.
- The History of Civilisation , in one pithy sentence.
Soapy Sam is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th July 2006, 06:39 PM   #10
Rat
Not bored. Never bored.
Moderator
 
Rat's Avatar
 
Join Date: May 2003
Location: Leicester, UK
Posts: 7,085
Two sentences, surely? And only one of them particularly pithy, I'd've thought.

Cheers,
Rat.
__________________
"Man muß den Menschen vor allem nach seinen Lastern beurteilen. Tugenden können vorgetäuscht sein. Laster sind echt." - Klaus Kinski
UKLS 1988-
Sitting on the fence throwing stones at both sides.
Rat is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 30th July 2006, 10:42 PM   #11
a_unique_person
Director of Hatcheries and Conditioning
 
a_unique_person's Avatar
 
Join Date: Jul 2002
Location: Mt Disappointment
Posts: 33,334
What is the regional location for the machine set to? A lot of programs get the date format from that.
__________________
Continually pushing the boundaries of mediocrity.
Everything is possible, but not everything is probable.
For if a man pretend to me that God hath spoken to him supernaturally, and immediately, and I make doubt of it, I cannot easily perceive what argument he can produce to oblige me to believe it. Hobbes
a_unique_person is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Reply

JREF Forum » General Topics » Computers and the Internet

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 09:01 PM.
Powered by vBulletin. Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
© 2001-2012, James Randi Educational Foundation. All Rights Reserved.

Disclaimer: Messages posted in the Forum are solely the opinion of their authors.