DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jun 2004
    Posts
    17

    Date checking problem.

    Hi,

    I have a problem with date checking.

    In my .jsp page it has a HTML form which prompts to enter date and some other fields.

    When the user enter the date into the textbox, I want to check is it a valid date or

    not.

    I'm using MySQL with JSP 1.2 to do this task. According to the MySQL documentation, it

    tells that it recognized the date format as follows.

    YYYY-MM-DD
    YY-MM-DD

    As an example when the user enters the date as follows
    2004-01-31 or 04-01-31 or 4-1-31

    then the db saves as 2004-01-31.

    When the user enters the date as 01-31-2004 or 01-32-2004 this saves as 0000-00-00.

    Now, my problem is how can I check that the user entered the date as correct

    format(year-month-day) and is it a valid date? I also want to check it for leap year.

    Is there any method to do this? If you know to solve this, please tell me.

    Thanks.

  2. #2
    Join Date
    Jun 2004
    Posts
    199

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links