本文整理汇总了Java中java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME属性的典型用法代码示例。如果您正苦于以下问题:Java DateTimeFormatter.ISO_ZONED_DATE_TIME属性的具体用法?Java DateTimeFormatter.ISO_ZONED_DATE_TIME怎么用?Java DateTimeFormatter.ISO_ZONED_DATE_TIME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.format.DateTimeFormatter
的用法示例。
在下文中一共展示了DateTimeFormatter.ISO_ZONED_DATE_TIME属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
@Before
public void setUp() {
final DateTimeFormatter dtf = DateTimeFormatter.ISO_ZONED_DATE_TIME;
seriesForRun = new MockTimeSeries(
new double[] { 1d, 2d, 3d, 4d, 5d, 6d, 7d, 8d, 9d },
new ZonedDateTime[] {
ZonedDateTime.parse("2013-01-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2013-08-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2013-10-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2013-12-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2014-02-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2015-01-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2015-08-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2015-10-01T00:00:00-05:00", dtf),
ZonedDateTime.parse("2015-12-01T00:00:00-05:00", dtf)
});
manager = new TimeSeriesManager(seriesForRun);
strategy = new BaseStrategy(new FixedRule(0, 2, 3, 6), new FixedRule(1, 4, 7, 8));
strategy.setUnstablePeriod(2); // Strategy would need a real test class
}
示例2: testWithZoneWithOffset
@Test(dataProvider="parseWithZoneWithOffset")
public void testWithZoneWithOffset(String zdtString, LocalDateTime ldt, ZoneOffset offset, ZoneId zone) {
dtFormatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
zdt1 = ZonedDateTime.ofInstant(ldt, offset, zone);
zdt2 = ZonedDateTime.parse(zdtString, dtFormatter);
assertEquals(zdt1, zdt2);
}
示例3: getTimestamp
private Timestamp getTimestamp(final String datetimeString) {
final DateTimeFormatter formatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
final ZonedDateTime dateTime = ZonedDateTime.parse(datetimeString.replace(" ", "T").replace(".0", "+00:00"), formatter);
final ZonedDateTime zonedDateTime = dateTime.withZoneSameLocal(DatumUtil.NL_ZONE_ID);
return new Timestamp(zonedDateTime.toInstant().toEpochMilli());
}
示例4: setUp
@BeforeMethod
public void setUp() throws Exception {
dtFormatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
}