Yes, for these reasons, DateMidnight isn't a great class. Generally
you want LocalDate instead.

I believe that svn will handle the case slightly better and choose the
earliest possible time on the requested date.

Stephen


On 3 March 2011 21:35, Adam Vartanian <[email protected]> wrote:
>> I've detected a bug I think. I cannot create an instance of DateMidnight on
>> April 6, 1980
>
> Actually, this is correct behavior, according to how Joda-Time works.
> There is no midnight on April 6, 1980, in the Europe/Vienna timezone.
> Time skipped directly from April 5, 1980, 11:59 to April 6, 1980,
> 1:00.
>
> If you want to represent a day in the abstract, rather than actually
> midnight on that day, you should use LocalDate.  If you need the first
> instant of that day (in that timezone), you can use
> LocalDate.toDateTimeAtStartOfDay().
>
> If you really need midnight on that day, you're out of luck, as it
> never happened.
>
> - Adam
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Joda-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to