Examples of toGeneralizedTime()


Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

        result = generalizedTime.toGeneralizedTime( Format.YEAR_MONTH_DAY_HOUR_MIN, null, 0,
            TimeZoneFormat.DIFF_HOUR_MINUTE );
        assertEquals( "200801021213+0000", result );

        result = generalizedTime.toGeneralizedTime( Format.YEAR_MONTH_DAY_HOUR, null, 0,
            TimeZoneFormat.DIFF_HOUR_MINUTE );
        assertEquals( "2008010212+0000", result );
    }
   
   
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

    @Test
    public void testAdjustWhileFormatting() throws ParseException
    {
        String gt = "20080102121314+0130";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
       
        result = generalizedTime.toGeneralizedTime( Format.YEAR_MONTH_DAY_HOUR_MIN_SEC, null, 0, TimeZoneFormat.Z );
        assertEquals( "20080102104314Z", result );
    }
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

        String gt = "20080102121314+0130";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
       
        result = generalizedTime.toGeneralizedTime( Format.YEAR_MONTH_DAY_HOUR_MIN_SEC, null, 0, TimeZoneFormat.Z );
        assertEquals( "20080102104314Z", result );
    }


    /**
 
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

    @Test
    public void testFebruary29inLeapYear() throws ParseException
    {
        String gt = "20080229000000Z";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }


    /**
 
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

        calendar.set( Calendar.MINUTE, 13 );
        calendar.set( Calendar.SECOND, 14 );
        calendar.setTimeZone( TimeZone.getTimeZone( "GMT" ) );

        GeneralizedTime generalizedTime = new GeneralizedTime( calendar );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( "20080102121314Z", result );
    }


    /**
 
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

        // create form calendar
        GeneralizedTime generalizedTime1 = new GeneralizedTime( calendar );

        // get the string value
        String gt1 = generalizedTime1.toGeneralizedTime();
        Calendar calendar1 = generalizedTime1.getCalendar();

        // create from string value
        GeneralizedTime generalizedTime2 = new GeneralizedTime( gt1 );
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

        // create from string value
        GeneralizedTime generalizedTime2 = new GeneralizedTime( gt1 );

        // get the calendar value
        Calendar calendar2 = generalizedTime2.getCalendar();
        String gt2 = generalizedTime2.toGeneralizedTime();

        // assert that all are equal
        assertEquals( calendar, calendar1 );
        assertEquals( calendar, calendar2 );
        assertEquals( calendar1, calendar2 );
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

     */
    public void testDIRSHARED29() throws ParseException
    {
        String gt = "20090312123456+0130";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }
}
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

        try
        {
            String prepared = PrepareString.normalize( value, PrepareString.StringType.DIRECTORY_STRING );

            GeneralizedTime time = new GeneralizedTime( prepared );
            String normalized = time.toGeneralizedTime( Format.YEAR_MONTH_DAY_HOUR_MIN_SEC_FRACTION,
                FractionDelimiter.DOT, 3, TimeZoneFormat.Z );

            return normalized;
        }
        catch ( IOException ioe )
View Full Code Here

Examples of org.apache.directory.shared.util.GeneralizedTime.toGeneralizedTime()

    @Test
    public void testYearMonthDayHourMinDotFractionMinusHourMin() throws ParseException
    {
        String gt = "200801021213.987-1030";
        GeneralizedTime generalizedTime = new GeneralizedTime( gt );
        String result = generalizedTime.toGeneralizedTime();
        assertEquals( gt, result );
    }


    /**
 
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.