473,322 Members | 1,405 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,322 software developers and data experts.

check for a valid date

50
I have another problem concerning to check if a particular date belongs in a particular range. For example I need to check whether 16th december lies between 10th December and 20th December. I have a startdate and an endDate of type Date. The Date startDate and Date endDate attributes are the ranges for a Date input. I need to check whether the attribute input lies between startDate and endDate.

Can please some1 tell me how can i implement this?

Thanks.
Dec 16 '07 #1
4 2998
sicarie
4,677 Expert Mod 4TB
Did you check out the Date class documentation? There are two boolean isBefore() and isAfter() methods, or the compareTo() method, or.... well, take a look!
Dec 16 '07 #2
sugard
50
Did you check out the Date class documentation? There are two boolean isBefore() and isAfter() methods, or the compareTo() method, or.... well, take a look!
ok thanks! i ve arranged it!!:)
Dec 16 '07 #3
sicarie
4,677 Expert Mod 4TB
Great! Just as an FYI - if you are using a class like that, if you Google "Java date class" (or whatever class you are using) you will usually return the Javadoc within the first two or three returns - those are a great resource to be able to use and search on your own.

But, as always, if you get stuck on something please feel free to post again.
Dec 16 '07 #4
sugard
50
To tell you the truth , i searched through the API, but it didnt come into my mind to use the before()and after(). Well thanks again for your help!! :)
Dec 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Detlef Jockheck | last post by:
Hi, I would like to check if a string contains a valid date format (Format: "dd.mm.yyyy") or not. What is the best way to do this. regexp? At the moment it would be sufficient to check for...
15
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...
4
by: peter | last post by:
Does anyone have solid code for setting up a 30 day experiation timer on your software. -Peter
1
by: Thomas | last post by:
Hi all, i have to check if a value is a valid date format depending on a "format string" the user specified. For example: Format String: "dd/mm/yyyy" Date Value: "01/12/2006" Valid: Yes! ...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
2
by: John Smith | last post by:
Hello, I have a VB.NET application with a Windows form that have several textboxes fields where I have dates entered. I would like to do a date validation check after the the field is updated, so...
4
by: Simon Gare | last post by:
Hi all, below is an insert statement on an asp page that stores the date and time that a driver logged on, what I need is to check that they are now already logged on fields are SQL Server...
2
by: wizard | last post by:
Hello Friends, There is a PHP function checkdate to check if a date is a valid Gregorian date. Is there any such function to check for a valid time like something in hh:mm:ss format? If not, can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.