Best way to get maximum Date value in java?

前端 未结 9 1260
眼角桃花
眼角桃花 2020-12-01 13:55

I\'m writing a bit of logic that requires treating null dates as meaning forever in the future (the date in question is an expiration date, which may or may not exist). Inst

9条回答
  •  無奈伤痛
    2020-12-01 14:12

    have you considered adopting the use of Joda Time?

    It's slated to be included in java 7 as the basis for JSR-310

    The feature that may interest you is ZeroIsMaxDateTimeField which basically swaps zero fields for the maximum value for that field within the date-time.

提交回复
热议问题