• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ques on time/duration fields from db file

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we have to display the contect of db file as it is in jtable or it is advisable to edit the Time or duration field and display it.
the time should be in h:mm format like 01:15 am or
12:30 pm
And the duration should have a space between hr and mins like "1h 13 min".
pls reply asap.
 
Siddharth Mehrotra
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Reshma Das:
Do we have to display the contect of db file as it is in jtable or it is advisable to edit the Time or duration field and display it.
the time should be in h:mm format like 01:15 am or
12:30 pm
And the duration should have a space between hr and mins like "1h 13 min".
pls reply asap.


Hi reshma,
well as per the instruction manual, you have to show all the data that is there in db.db file, but what format to display is not given by them.
but they do mention that your design should have good HCI( human computer interface) so according to that i belive that showing the data in h:mm format is better as there might be some who belive that hours should be represented by h, for some it may be Hr, anad so on and so forth. So in order to remove comfusion i guess that the time should be displayed as 01:15 am or 12:30 pm ..

this is what i think...
what do you say...
i hope i have a valid point and this is what i have decided...
byee
 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I browsed few flight booking seats they too display time as 1:30 am or 12:30 pm.
I wrote the code for it but it is not working. can someone help me in finding the bug;
import java.text.SimpleDateFormat;
import java.util.Date;
class temp {
public static void main(String[] s) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("h:mm a");
Date currentTime_1 = new Date();
Date dt = df.parse("13:40");
System.out.println(df.format(dt));
System.exit(0);
}
}
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I think the problem with trying to convert their data to good looking times, is that they put minutes that are over 60. I don't know of any hour in the day that has more than 60 minutes.
I didn't convert the time, and I got perfect on GUI.
Thanks
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic