Examples of DateTimeFormatter


Examples of org.joda.time.format.DateTimeFormatter

    }

    private void checkJISOToString() {
        int COUNT = COUNT_SLOW;
        DateTime dt = new DateTime();
        DateTimeFormatter f = DateTimeFormat.forPattern("dd MMM yyyy");
        for (int i = 0; i < AVERAGE; i++) {
            start("JISO", "toString");
            for (int j = 0; j < COUNT; j++) {
                String str = dt.toString("dd MMM yyyy");
//                String str = dt.toString(f);
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter

        @Override
        public DateTime getTimeStamp() {
            DateTime dt = null;
            String text = getLabelElement().getText();
            String timeStamp = text.substring(text.indexOf('[') + 1, text.indexOf(']'));
            DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:m:s.S");
            try {
                dt = formatter.parseDateTime(timeStamp);
            } catch (IllegalArgumentException e) {
                throw new RuntimeException("Something went wrong with parsing of log entry timestamp!", e);
            }
            return dt;
        }
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter

            properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "0" ) );
        }

        // Need to get the ISO8601 date for properties
        DateTime dt = new DateTime( localResource.lastModified() );
        DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
        String modifiedDate = fmt.print( dt );

        properties.add( new DefaultDavProperty( DavPropertyName.GETLASTMODIFIED, modifiedDate ) );

        properties.add( new DefaultDavProperty( DavPropertyName.CREATIONDATE, modifiedDate ) );
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter

  public void testParseDateSampleDate() {
    String printed = "Tue, 22 Oct 2013 19:28:45 GMT";
    Date date = URLFetchUtils.parseDate(printed);
    assertNotNull(date);

    DateTimeFormatter gcsFormat =
        DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss z").withZoneUTC();
    assertEquals(printed.substring(0, printed.length() - 4),
        gcsFormat.print(date.getTime()).substring(0, printed.length() - 4));
  }
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter

    public void exportHtmlTableToExcel() throws IOException{       
       
        //Set the filename
        DateTime dt = new DateTime();
        DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd_HHmmss");
        String filename = dt.toString(fmt) + ".xls";
       
       
        //Setup the output
        String contentType = "application/vnd.ms-excel";
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter

        int rowCount = 0;
        int colCount = 0;
       
        //Set the filename
        DateTime dt = new DateTime();
        DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd_HHmmss");
        String filename = dt.toString(fmt);
       
       
        // Create Excel Workbook and Sheet
        HSSFWorkbook wb = new HSSFWorkbook();
View Full Code Here

Examples of org.threeten.bp.format.DateTimeFormatter

    //-----------------------------------------------------------------------
    // parse(DateTimeFormatter)
    //-----------------------------------------------------------------------
    @Test
    public void factory_parse_formatter() {
        DateTimeFormatter f = DateTimeFormatter.ofPattern("u M d H m s VV");
        ZonedDateTime test = ZonedDateTime.parse("2010 12 3 11 30 0 Europe/London", f);
        assertEquals(test, ZonedDateTime.of(LocalDateTime.of(2010, 12, 3, 11, 30), ZoneId.of("Europe/London")));
    }
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.