Results 1 to 3 of 3
  1. #1
    darshna is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default extract time from users input

    Hello, I am very busy at work .
    I have to write a class to extract time from users input and convert it into hh:mm:ss format.

    user can type time in only 12 hour clock format (in any format ) as below :

    4:5

    03/30

    330

    11:3

    please help.

    Thanks
    Darshna

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    I'm not 100% sure of precisely what it is you're trying to do, but I suspect that SimpleDateFormat is what you need to parse the user's input. You may need several of these objects or a more complex DateFormat object to do what you want.

  3. #3
    darshna is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default

    Thanks a lot for your reply


    I have to extract time from users input which will be in one of the formats below :

    User can type 03:30

    as

    3:30 or 33 or 033

    03:00:00 as :

    3.00, 3, 0300 , 3PM , 3:00 , 3/00 any of these user can input

    which needs to be converted to 03:00:00 (hh:mm:dd)

    User can enter maximum four digit (hh:mm)

    I have to convert it into hh:mm:ss format and store in the database.


    Thanks for youe help
    Darshna

Similar Threads

  1. problem with Scanner in Getting users input
    By kliane in forum New To Java
    Replies: 8
    Last Post: 01-17-2010, 04:37 PM
  2. To get time as input from user
    By yuvarani in forum New To Java
    Replies: 3
    Last Post: 12-16-2009, 12:19 PM
  3. validate time input format
    By Alairmon in forum New To Java
    Replies: 2
    Last Post: 11-04-2008, 07:39 AM
  4. how to extract the date n time from images
    By norazanita in forum New To Java
    Replies: 3
    Last Post: 06-20-2008, 05:45 PM
  5. Accounts of users
    By Eric in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-27-2007, 04:20 PM

Posting Permissions

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