Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert time to double

 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all I want to convert time to double as if suppose now time is 11hr and 40min . then I want to convert this into double as 11.40 how to do this?

 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it okay? any better solution?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would work, but I wonder why you would want to do that.
 
Rob Spoor
Sheriff
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
11.40 isn't an accurate representation of 11:40. You'd need to divide the minutes by 60, not 100, giving 11.66666666.... If you only need it for displaying use SimpleDateFormat instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic