Examples of toInstant()


Examples of com.opengamma.util.time.Expiry.toInstant()

    String displayName = euroBondFuture.getName();
    assertNotNull(displayName);
    assertTrue(displayName.contains("EURO-BUND FUTURE"));
    Expiry expiry = euroBondFuture.getExpiry();
    assertNotNull(expiry);
    assertTrue(expiry.toInstant().isAfter(getTodayInstant()));
    assertEquals("XEUR", euroBondFuture.getTradingExchange());
    assertEquals("XEUR", euroBondFuture.getSettlementExchange());
    //assert identifiers are set
    Collection<ExternalId> identifiers = euroBondFuture.getExternalIdBundle().getExternalIds();
    assertNotNull(identifiers);
View Full Code Here

Examples of java.util.Date.toInstant()

        Date dt = (Date) value[0];
        if (dt == null) {
            return null;
        }
        ZoneId zone = ZoneId.of((String) value[1]);
        LocalDateTime ldt = LocalDateTime.from(dt.toInstant());
        return ZonedDateTime.of(ldt, zone);
    }

    @Override public Object[] fromJava(ZonedDateTime value) {
        if (value == null) {
View Full Code Here

Examples of java.util.Date.toInstant()

        Date dt = (Date) value[0];
        if (dt == null) {
            return null;
        }
        ZoneOffset zone = ZoneOffset.of((String) value[1]);
        LocalDateTime ldt = LocalDateTime.ofInstant(dt.toInstant(), zone);
        return OffsetDateTime.of(ldt, zone);
    }

    @Override public Object[] fromJava(OffsetDateTime value) {
        if (value == null) {
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

        assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, new Instant(0L)).getClass());
       
        DateTime cutover = new DateTime(1582, 10, 15, 0, 0, 0, 0, DateTimeZone.UTC);
        chrono = GJChronology.getInstance(TOKYO, null);
        assertEquals(TOKYO, chrono.getZone());
        assertEquals(cutover.toInstant(), chrono.getGregorianCutover());
    }

    public void testFactory_Zone_RI_int() {
        GJChronology chrono = GJChronology.getInstance(TOKYO, new Instant(0L), 2);
        assertEquals(TOKYO, chrono.getZone());
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

        assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, new Instant(0L), 2).getClass());
       
        DateTime cutover = new DateTime(1582, 10, 15, 0, 0, 0, 0, DateTimeZone.UTC);
        chrono = GJChronology.getInstance(TOKYO, null, 2);
        assertEquals(TOKYO, chrono.getZone());
        assertEquals(cutover.toInstant(), chrono.getGregorianCutover());
        assertEquals(2, chrono.getMinimumDaysInFirstWeek());
       
        try {
            GJChronology.getInstance(TOKYO, new Instant(0L), 0);
            fail();
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

        System.out.println("Min allowed value:    in.dayOfWeek().getMinimumValue():       " + in.dayOfWeek().getMinimumValue());
        System.out.println("Copy & set to Jan:    in.monthOfYear().setCopy(1):            " + in.monthOfYear().setCopy(1));
        System.out.println("Copy & add 14 months: in.monthOfYear().addCopy(14):           " + in.monthOfYear().addToCopy(14));
        System.out.println("Add 14 mnths in field:in.monthOfYear().addWrapFieldCopy(14):  " + in.monthOfYear().addWrapFieldToCopy(14));
        System.out.println("...");
        System.out.println("Convert to Instant:   in.toInstant():           " + in.toInstant());
        System.out.println("Convert to DateTime:  in.toDateTime():          " + in.toDateTime());
        System.out.println("Convert to MutableDT: in.toMutableDateTime():   " + in.toMutableDateTime());
        System.out.println("Convert to Date:      in.toDate():              " + in.toDate());
        System.out.println("Convert to Calendar:  in.toCalendar(Locale.UK): " + in.toCalendar(Locale.UK).toString().substring(0, 46));
        System.out.println("Convert to GregCal:   in.toGregorianCalendar(): " + in.toGregorianCalendar().toString().substring(0, 46));
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

        assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, new Instant(0L)).getClass());
       
        DateTime cutover = new DateTime(1582, 10, 15, 0, 0, 0, 0, DateTimeZone.UTC);
        chrono = GJChronology.getInstance(TOKYO, null);
        assertEquals(TOKYO, chrono.getZone());
        assertEquals(cutover.toInstant(), chrono.getGregorianCutover());
    }

    public void testFactory_Zone_RI_int() {
        GJChronology chrono = GJChronology.getInstance(TOKYO, new Instant(0L), 2);
        assertEquals(TOKYO, chrono.getZone());
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

        assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, new Instant(0L), 2).getClass());
       
        DateTime cutover = new DateTime(1582, 10, 15, 0, 0, 0, 0, DateTimeZone.UTC);
        chrono = GJChronology.getInstance(TOKYO, null, 2);
        assertEquals(TOKYO, chrono.getZone());
        assertEquals(cutover.toInstant(), chrono.getGregorianCutover());
        assertEquals(2, chrono.getMinimumDaysInFirstWeek());
       
        try {
            GJChronology.getInstance(TOKYO, new Instant(0L), 0);
            fail();
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

     * Used after deletion of the post. It is necessary to save the sort order of topics in the future.
     */
    public void recalculateModificationDate() {
        DateTime newTopicModificationDate = getFirstPost().getCreationDate();
        for (Post post : posts) {
            if (post.getCreationDate().isAfter(newTopicModificationDate.toInstant())) {
                newTopicModificationDate = post.getCreationDate();
            }
        }
        modificationDate = newTopicModificationDate;
    }
View Full Code Here

Examples of org.joda.time.DateTime.toInstant()

     * Get the date of the last modification of posts in the current topic.
     */
    public DateTime getLastModificationPostDate() {
        DateTime newTopicModificationDate = getFirstPost().getLastTouchedDate();
        for (Post post : posts) {
            if (post.getLastTouchedDate().isAfter(newTopicModificationDate.toInstant())) {
                newTopicModificationDate = post.getLastTouchedDate();
            }
        }
        return newTopicModificationDate;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.