Examples of withZone()


Examples of com.facebook.presto.jdbc.internal.joda.time.Chronology.withZone()

     * @param zone time zone to apply, or default if null
     * @return a DateTime using the same millis
     */
    public DateTime toDateTime(DateTimeZone zone) {
        Chronology chrono = DateTimeUtils.getChronology(getChronology());
        chrono = chrono.withZone(zone);
        return new DateTime(getMillis(), chrono);
    }

    /**
     * Get this object as a DateTime using the given chronology and its zone.
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.joda.time.DateTime.withZone()

                } else if (bucket.getZone() != null) {
                    chrono = chrono.withZone(bucket.getZone());
                }
                DateTime dt = new DateTime(millis, chrono);
                if (iZone != null) {
                    dt = dt.withZone(iZone);
                }
                return dt;
            }
        } else {
            newPos = ~newPos;
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.joda.time.format.DateTimeFormatter.withZone()

            formatter = DateTimeFormat.forPattern(format);
        }
        if (_locale != null) {
            formatter = formatter.withLocale(_locale);
        }
        formatter = formatter.withZone(_formatter.getZone());
        return new JacksonJodaFormat(this, formatter);
    }
   
    protected JacksonJodaFormat withTimeZone(TimeZone tz) {
        if ((tz == null) || (_jdkTimezone != null && _jdkTimezone.equals(tz))) {
View Full Code Here

Examples of java.time.format.DateTimeFormatter.withZone()

    else if (this.timeStyle != null) {
      dateTimeFormatter = DateTimeFormatter.ofLocalizedTime(this.timeStyle);
    }

    if (dateTimeFormatter != null && this.timeZone != null) {
      dateTimeFormatter = dateTimeFormatter.withZone(this.timeZone.toZoneId());
    }
    return (dateTimeFormatter != null ? dateTimeFormatter : fallbackFormatter);
  }

}
View Full Code Here

Examples of org.elasticsearch.common.joda.time.format.DateTimeFormatter.withZone()

                DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder()
                        .append(DateTimeFormat.forPattern(formats[0]).withZone(DateTimeZone.UTC).getPrinter(), parsers);
                formatter = builder.toFormatter();
            }
        }
        return new FormatDateTimeFormatter(input, formatter.withZone(DateTimeZone.UTC));
    }
}
View Full Code Here

Examples of org.goda.time.Chronology.withZone()

     * @param zone time zone to apply, or default if null
     * @return a DateTime using the same millis
     */
    public DateTime toDateTime(DateTimeZone zone) {
        Chronology chrono = DateTimeUtils.getChronology(getChronology());
        chrono = chrono.withZone(zone);
        return new DateTime(getMillis(), chrono);
    }

    /**
     * Get this object as a DateTime using the given chronology and its zone.
View Full Code Here

Examples of org.joda.time.Chronology.withZone()

        int newPos = parser.parseInto(bucket, text, position);
        instant.setMillis(bucket.computeMillis(false, text));
        if (iOffsetParsed && bucket.getZone() == null) {
            int parsedOffset = bucket.getOffset();
            DateTimeZone parsedZone = DateTimeZone.forOffsetMillis(parsedOffset);
            chrono = chrono.withZone(parsedZone);
        }
        instant.setChronology(chrono);
        return newPos;
    }
View Full Code Here

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

            dt = dt.withHourOfDay((p & 0x1F));
            dt = dt.withMinuteOfHour(((s >>> 26) & 0x3F));
            dt = dt.withSecondOfMinute(((s >>> 20) & 0x3F));
            // marsaling dumps usec, not msec
            dt = dt.withMillisOfSecond((s & 0xFFFFF) / 1000);
            dt = dt.withZone(getLocalTimeZone(runtime));
            time.setUSec((s & 0xFFFFF) % 1000);
        }
        time.setDateTime(dt);

        from.getInstanceVariables().copyInstanceVariablesInto(time);
View Full Code Here

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

    public void testFormat_hourOfHalfday() {
        DateTime dt = new DateTime(2004, 6, 9, 10, 20, 30, 40, UTC);
        DateTimeFormatter f = DateTimeFormat.forPattern("K").withLocale(Locale.UK);
        assertEquals(dt.toString(), "10", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "6", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "7", f.print(dt));
       
View Full Code Here

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

        assertEquals(dt.toString(), "10", f.print(dt));
       
        dt = dt.withZone(NEWYORK);
        assertEquals(dt.toString(), "6", f.print(dt));
       
        dt = dt.withZone(TOKYO);
        assertEquals(dt.toString(), "7", f.print(dt));
       
        dt = new DateTime(2004, 6, 9, 0, 0, 0, 0, UTC);
        assertEquals(dt.toString(), "0", f.print(dt));
    }
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.