Results 1 to 1 of 1
Thread: Time bogging matter
- 03-01-2011, 10:31 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 1
- Rep Power
- 0
Time bogging matter
Hi, hoping one could help :)
I have this minor problem. I am trying to develop something that enables one to type in the time and then when submitted it should print it the way it has been entered.
Following is my code:
text += "Name : "+ name;
text += "\nDay: " + user.getDay();
text += "\nHour: " + hour +":"+ minutes;
text += "\nActivity: " + user.getRandomActivity();
if (name == null || name.equals("")) ;
if ((hour<10) || (hour>16) || (minutes<00) || (minutes>59)){
pageContext.forward( "ErrorPage.jsp" );
} else {
out.println(text);
}
If the time as been entered as 09:03, it will print as 9:3. How can i fix this?
And also, if one is able to give the extra help... i want to be able to allow the user to enter between 10:00 and 17:00. Is there an alternative to the way i've done it. Its not as good as it could be, i cant type in "17:00" at this point.
Thanks in advance for the help :DLast edited by zNinjaa; 03-01-2011 at 10:35 PM.
Similar Threads
-
JAVA Programmers Wanted - Full-Time and Part-Time Positions open
By javatrek2020 in forum Jobs OfferedReplies: 3Last Post: 08-23-2011, 12:46 PM -
Does regional settings matter when parsing Strings to numbers?
By lrocha in forum Advanced JavaReplies: 6Last Post: 12-10-2010, 08:43 AM -
the matter of "Data Structures" cover first from Algorithms or from Java and after th
By lse123 in forum New To JavaReplies: 4Last Post: 06-08-2010, 12:35 AM -
calculate time diff for particular time period
By baktha.thalapathy in forum New To JavaReplies: 2Last Post: 05-24-2010, 04:10 PM -
Error message pops up no matter what?
By murr0508 in forum New To JavaReplies: 5Last Post: 02-26-2009, 10:10 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks