Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent time of day (ie. 19:00) in Java?

Tags:

java

jodatime

What's the correct way to represent time of day in Java?

For example: 09:00, 19:30, etc.

Basically this is a time of day not linked to an actual date/day.

like image 540
CodingHero Avatar asked Mar 22 '13 14:03

CodingHero


1 Answers

You've already tagged this with jodatime.

The Joda Time type for storing a time of day is org.joda.time.LocalTime. See the Joda Time API documentation.

like image 151
Jesper Avatar answered Oct 19 '22 00:10

Jesper