I am translating some C#-code to Java, and have chosen JodaTime
's DateTime
class, to replace C#
's System.DateTime
.
In C#
the DateTime
class has a Field called MaxValue
and one called MinValue
, which returns the biggest and smallest possible value that the DateTime
object can hold.
I am trying to achieve the same with the JodaTime
api. I have read some suggestions on other posts
This one: Java equivalent of .NET DateTime.MinValue, DateTime.Today answers how to make today's date in JodaTime
, but when answering the second half of the question, about Min Values, they turn to Calendar
and Date
Likewise I have seen suggestions about passing a maximized long value as constructor parameter, but it was criticized for being dependant on classes that might be changed in the future, and therefor might not be compatible or accurat after API updates.
So, is there a single positively correct way to do this? If not, is there a good way to achieve this?