Best way to get maximum Date value in java?

前端 未结 9 1285
眼角桃花
眼角桃花 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:08

    Perhaps one option is to use the maximal system date. You can get it by using:

    System.out.println(new Date(Long.MAX_VALUE).toString())
    //Output:
    //Sun Aug 17 12:42:55 IST 292278994
    

提交回复
热议问题