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
2
votes
1answer
40 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 ...
1
vote
2answers
37 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 ...
1
vote
0answers
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 ...
2
votes
1answer
10k 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. ...
2
votes
1answer
1k views

Creating custom week start and week number

...
6
votes
1answer
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. ...
6
votes
2answers
742 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,...
3
votes
2answers
32k 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 ...
3
votes
3answers
2k views

Creating students and instructors

It's simple. Person is a superclass. Student and Instructor are its subclasses. The program ...
2
votes
2answers
429 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 ...
24
votes
2answers
56k 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 ...