• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

ques on time/duration fields from db file

 
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.
 
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);
}
}
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic