當前位置: 首頁>>代碼示例>>Java>>正文


Java ChronoField.EPOCH_DAY屬性代碼示例

本文整理匯總了Java中java.time.temporal.ChronoField.EPOCH_DAY屬性的典型用法代碼示例。如果您正苦於以下問題:Java ChronoField.EPOCH_DAY屬性的具體用法?Java ChronoField.EPOCH_DAY怎麽用?Java ChronoField.EPOCH_DAY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.time.temporal.ChronoField的用法示例。


在下文中一共展示了ChronoField.EPOCH_DAY屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: data_samples

@DataProvider(name="samples")
Object[][] data_samples() {
    return new Object[][] {
        {ChronoField.EPOCH_DAY, JAN01_1970, 0L},
        {JulianFields.JULIAN_DAY, JAN01_1970, 2400001L + 40587L},
        {JulianFields.MODIFIED_JULIAN_DAY, JAN01_1970, 40587L},
        {JulianFields.RATA_DIE, JAN01_1970, 710347L + (40587L - 31771L)},

        {ChronoField.EPOCH_DAY, DEC31_1969, -1L},
        {JulianFields.JULIAN_DAY, DEC31_1969, 2400001L + 40586L},
        {JulianFields.MODIFIED_JULIAN_DAY, DEC31_1969, 40586L},
        {JulianFields.RATA_DIE, DEC31_1969, 710347L + (40586L - 31771L)},

        {ChronoField.EPOCH_DAY, NOV12_1945, (-24 * 365 - 6) - 31 - 30 + 11},
        {JulianFields.JULIAN_DAY, NOV12_1945, 2431772L},
        {JulianFields.MODIFIED_JULIAN_DAY, NOV12_1945, 31771L},
        {JulianFields.RATA_DIE, NOV12_1945, 710347L},

        {ChronoField.EPOCH_DAY, JAN01_0001, (-24 * 365 - 6) - 31 - 30 + 11 - 710346L},
        {JulianFields.JULIAN_DAY, JAN01_0001, 2431772L - 710346L},
        {JulianFields.MODIFIED_JULIAN_DAY, JAN01_0001, 31771L - 710346L},
        {JulianFields.RATA_DIE, JAN01_0001, 1},
    };
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:24,代碼來源:TCKJulianFields.java


注:本文中的java.time.temporal.ChronoField.EPOCH_DAY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。