Questions tagged [jodatime]

Joda-Time provides a quality replacement for the Java date and time classes. The design allows for multiple calendar systems, while still providing a simple API.

Filter by
Sorted by
Tagged with
3 votes
2 answers
721 views

Check if current time is within the timeframe using Joda-Time

Novice Java developer here. I've never really used a time/date library before and I'm curious how an experienced developer would solve this. You're given 4 ints: startHour, startMinute, endHour and ...
yinder's user avatar
  • 33
1 vote
2 answers
164 views

Generate n appointments in the next m months

I work with an API where I need to write code to generate n appointment dates in the coming m months (from today). For the purpose, I write a Random date generator class provided. One condition is I ...
Arefe's user avatar
  • 217
1 vote
0 answers
2k views

Correcting time in DST gap using Joda Time

We have a class which acts as a time interval, containing a LocalDate and two counts of minutes since midnight. One of the methods on this class converts these values into two DateTimes. Since ...
Gotler's user avatar
  • 11
2 votes
1 answer
18k views

Check if the user is 18 years old (upto days)

This code is returning 'true' for any date which are later than Feb 24, 1998. ...
Em Ae's user avatar
  • 291
2 votes
1 answer
2k views

Creating custom week start and week number

...
emaNoN's user avatar
  • 23
6 votes
1 answer
2k views

Summing two time periods using JodaTime

I'm building a Java method to sum arithmetically two time periods, using the JodaTime library. My code works fine, but I think that it's possible optimize to reduce the time execution. ...
user3449772's user avatar
6 votes
2 answers
855 views

Computing the electricity consumption of a client

I have a year or so of experience in developing in Java. I submitted the solution for this task, but never got the feedback that was promised. Since I still would like to get a feedback on my solution,...
kristjanroosild's user avatar
3 votes
2 answers
36k views

Converting timedate timezones with Joda-Time

I've been struggling to get to grips with Joda-Time, but feel that I've finnaly managed to get a grip on some of the functionality that I need. I have written a function that will convert a ...
Jarede's user avatar
  • 309
3 votes
3 answers
2k views

Creating students and instructors

It's simple. Person is a superclass. Student and Instructor are its subclasses. The program ...
LordofDrol's user avatar
2 votes
2 answers
488 views

At most one LocalDate per month in a list

I'm implementing argument check in a method where one parameter is a List of LocalDate objects (from Joda-Time). I want to make ...
Jonik's user avatar
  • 257
29 votes
2 answers
65k views

JAXB XJC code generation - adding @XmlRootElement and Joda DateTime

Here's an interesting scenario that I encountered the other day. I did eventually reach a solution on my own. However, I'd welcome any comments and better approaches. The requirements I want to ...
Gary's user avatar
  • 391