Results 1 to 3 of 3
Thread: validate time input format
- 11-04-2008, 06:31 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 1
- Rep Power
- 0
- 11-04-2008, 06:51 AM #2
And what input is valid for your mind?Can you ask clearer the question and please show what you have done,any lines of code.
- 11-04-2008, 07:39 AM #3
Here's an algo( if you didn't try it yet )
given unknown value, and expecting there is a colon(:) on that value,
try to split the data(preferably String) through colon(:)
Check if returned String array has length of 2 (0 - 1 are despaired)
you may use the try/catch to validate the data by converting the strings into an integer
once they are valid integers, try to check if the first datum is greater than 23(max time is 23:59) and if the second datum is greater than 59,
if both comparison are satisfied, then play with those data....freedom exists in the world of ideas
Similar Threads
-
How to validate date using SampleDateFormat
By Java Tip in forum java.textReplies: 0Last Post: 04-04-2008, 02:38 PM -
repaint validate doLayout
By Gajesh Tripathi in forum AWT / SwingReplies: 1Last Post: 10-27-2007, 06:53 PM -
How to validate date using SampleDateFormat
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:31 PM -
validate hex character
By paul in forum New To JavaReplies: 1Last Post: 07-25-2007, 09:08 PM -
how to take input and verify input in Java programs
By bilal_ali_java in forum Advanced JavaReplies: 0Last Post: 07-21-2007, 08:46 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks