File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting the maximum/min date java.util.Calendar can accomodate

 
Sam Ingrassia
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to everyone in advance -

Coming from other languages such as PHP, the DateTime object has max and min dates that the respective object will allow. For instance PHP's DateTime is:

$MinValue = "1901-12-13 20:45:54";
$MaxValue = "2038-01-19 03:14:07";

And C#:

DateTime.MaxValue
DateTime.MinValue

I have played around with calendars getMinimum/getMaximum methods and here is what I come up with

this is the minimum date - Thu, 1 Jan 0001 00:00:00 -0700 (does not change)

this is the max date - Wed, 17 Apr 292269054 21:34:07 -0700 (the second is constantly changing)

Am I on the right path or is there a better way to get max/min Calendar dates that are constant?


Thanks,

Sam




 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sort of, but you can get earlier dates than that by using negative numbers. As you can see, you can use any date which would be of any use to any human being in Java. So whereas the question might have a point in PHP, it doesn't have a point in Java.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic