473,804 Members | 3,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

check for invalid date

If I check for a invalid date e.g. February 30th, 2008?

Andrew Poulos
Feb 14 '08 #1
2 4026
On Feb 15, 9:23 am, Andrew Poulos <ap_p...@hotmai l.comwrote:
If I check for a invalid date e.g. February 30th, 2008?
Try something from here:

<URL: http://www.merlyn.demon.co.uk/js-date4.htm#DVal >
--
Rob
Feb 15 '08 #2
In comp.lang.javas cript message <47b4cd6e$0$202 16$5a62ac22@per-
qv1-newsreader-01.iinet.net.au >, Fri, 15 Feb 2008 10:23:49, Andrew
Poulos <ap*****@hotmai l.composted:
>If I check for a invalid date e.g. February 30th, 2008?
Reading the newsgroup FAQ with care should help you, provided that the
version you choose is not too recent.

Since new Date() accepts both "13/11/2008" and "11/13/2008", one
cannot rely solely on new Date() . Indeed, even if you try all
browsers that you have, you still cannot rely on it, as date string
formats are not specified in ISO/IEC 16262.

You will, therefore, need to know something about the possible formats
that you may encounter - for example, will the month always be a word
rather than a number? May it be abbreviated? How much?

XP sp2 IE6 accepts new Date("Ju 30th, 2008") giving July 30th.

Read <URL:http://www.merlyn.demo n.co.uk/js-date4.htm>.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk IE6 IE7 FF2 Op9 Sf3
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Feb 15 '08 #3

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

Similar topics

15
6987
by: Dan S | last post by:
My application asks the user to enter in a date - in the mm/dd/yyyy format. Is there any quick and easy way to verify the date the user enters is formatted correctly? Right now I'm calling DateTime.Parse() and catching the FormatException but it seems this is a bit inefficient - catching the exception that is. There is some pretty obvious delay while it traces back up the call stack. Is there a better way? Something that returns a bool...
5
2285
by: TN Bella | last post by:
Trying to check if an entry for an date is < 3 years to current date or > 30 days from current date. How can I do this in asp.net....? Do I need to use the customvalidation. Can anyone give me an example? Thanks in advance for the help *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it!
2
5198
by: LitelWang | last post by:
I need this function : CheckDate('2002-02-29') return false CheckDate('2002-02-28') return true How to write ? Thanks for any advice .
9
6658
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its length is 642 bytes ( I have appended it to the end of this message). I suspect that the reason may have something to do with an incorrect declaration of which class to de-serialize to. In the attached code I substituted @@@@@@@ in the code below with...
5
2323
by: Notgiven | last post by:
You want to check scheduling conflicts and you have a record like: appointments(table): apptID beginningDate endingDate beginningTime endingTime It's easy enough to check if a time is within that record. Say you want to
1
2983
by: romiko2000 | last post by:
Hi Folks, I got a weird problem, I create an XMLWriter to post a document via the webrequest stream and after running a network trace, I notice the data is prefixed with 3 invalid characters! The invalid characters are: ef bb bf, at the top of the stream, which are . Why is this occuring, I am totally baffled by this? Here is the stream:
4
2146
geo039
by: geo039 | last post by:
I tried to write a simple application that takes user input by text and time selected by date time picker. It displays the appt description in one list box and the time in another list box. I wrote a simple function that checks the times for duplicates. I wanted to check for a duplicate before it writes to the listbox by returning a boolean (true/false) value. I only need to check hours and minutes not date or seconds. The following is...
9
5900
by: User | last post by:
Hi, Assuming the date format is in 31-Feb-2006 <head> <script language="javascript"> function t() { mill=new Date(2006, 01, 31) ;
3
7351
by: lenygold via DBMonster.com | last post by:
Thank you very much SERGE for your help. I found example in Graeme Birchall COOKBOOK wich i think exactly what i need for SQL check in triggers: • User query joins to table function - sends DML or DDL statement to be executed. • Table function calls stored procedure - sends statement to be executed. • Stored procedure executes statement. • Stored procedure returns SQLCODE of statement to the table function.
0
9589
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10329
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,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
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
6858
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.