Results 1 to 1 of 1
  1. #1
    zNinjaa is offline Member
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Default 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 :D
    Last edited by zNinjaa; 03-01-2011 at 11:35 PM.

Similar Threads

  1. Replies: 3
    Last Post: 08-23-2011, 01:46 PM
  2. Replies: 6
    Last Post: 12-10-2010, 09:43 AM
  3. Replies: 4
    Last Post: 06-08-2010, 01:35 AM
  4. calculate time diff for particular time period
    By baktha.thalapathy in forum New To Java
    Replies: 2
    Last Post: 05-24-2010, 05:10 PM
  5. Error message pops up no matter what?
    By murr0508 in forum New To Java
    Replies: 5
    Last Post: 02-26-2009, 11:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •