Examples of dayOfYear()


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

        assertFunction("day_of_week(" + seconds + ")", dateTime.dayOfWeek().get());
        assertFunction("dow(" + seconds + ")", dateTime.dayOfWeek().get());
        assertFunction("day(" + seconds + ")", dateTime.getDayOfMonth());
        assertFunction("day_of_month(" + seconds + ")", dateTime.getDayOfMonth());
        assertFunction("day_of_year(" + seconds + ")", dateTime.dayOfYear().get());
        assertFunction("doy(" + seconds + ")", dateTime.dayOfYear().get());
        assertFunction("week(" + seconds + ")", dateTime.weekOfWeekyear().get());
        assertFunction("week_of_year(" + seconds + ")", dateTime.weekOfWeekyear().get());
        assertFunction("month(" + seconds + ")", dateTime.getMonthOfYear());
        assertFunction("quarter(" + seconds + ")", dateTime.getMonthOfYear() / 4 + 1);
        assertFunction("year(" + seconds + ")", dateTime.getYear());
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(DateType.class)
    public static long castToDate(ConnectorSession session, @SqlType(TimestampType.class) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = getChronology(session.getTimeZoneKey());
        long date = chronology.dayOfYear().roundFloor(value);
        // date is currently midnight in timezone of the session
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(DateType.class)
    public static long castToDate(ConnectorSession session, @SqlType(TimestampType.class) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = getChronology(session.getTimeZoneKey());
        long date = chronology.dayOfYear().roundFloor(value);
        // date is currently midnight in timezone of the session
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(DateType.class)
    public static long castToDate(@SqlType(TimestampWithTimeZoneType.class) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = unpackChronology(value);
        long date = chronology.dayOfYear().roundFloor(unpackMillisUtc(value));
        // date is currently midnight in timezone of the original value
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(StandardTypes.DATE)
    public static long castToDate(ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = getChronology(session.getTimeZoneKey());
        long date = chronology.dayOfYear().roundFloor(value);
        // date is currently midnight in timezone of the session
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(StandardTypes.DATE)
    public static long castToDate(@SqlType(StandardTypes.TIMESTAMP_WITH_TIME_ZONE) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = unpackChronology(value);
        long date = chronology.dayOfYear().roundFloor(unpackMillisUtc(value));
        // date is currently midnight in timezone of the original value
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(DateType.class)
    public static long castToDate(ConnectorSession session, @SqlType(TimestampType.class) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = getChronology(session.getTimeZoneKey());
        long date = chronology.dayOfYear().roundFloor(value);
        // date is currently midnight in timezone of the session
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.joda.time.chrono.ISOChronology.dayOfYear()

    @SqlType(DateType.class)
    public static long castToDate(@SqlType(TimestampWithTimeZoneType.class) long value)
    {
        // round down the current timestamp to days
        ISOChronology chronology = unpackChronology(value);
        long date = chronology.dayOfYear().roundFloor(unpackMillisUtc(value));
        // date is currently midnight in timezone of the original value
        // convert to UTC
        return date + chronology.getZone().getOffset(date);
    }
View Full Code Here

Examples of org.jquantlib.time.Date.dayOfYear()

        //Get the day of the date for it's month
        System.out.println("The day of the date as a day in this date's month(1-31) is = "+today.dayOfMonth());

        //Get the day of the date for it's year
        System.out.println("The day of the date as day in it's year(1-366) is = "+today.dayOfYear());

        //Check if the date belongs to a leap year
        if (Date.isLeap(today.year())) {
            System.out.println("Today's date belong to leap year");
        }
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.