- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.threeten.bp.ZoneId.systemDefault()
方法的一些代码示例,展示了ZoneId.systemDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneId.systemDefault()
方法的具体详情如下:
包路径:org.threeten.bp.ZoneId
类名称:ZoneId
方法名:systemDefault
[英]Gets the system default time-zone.
This queries TimeZone#getDefault() to find the default time-zone and converts it to a ZoneId. If the system default time-zone is changed, then the result of this method will also change.
[中]获取系统默认时区。
查询时区#getDefault()以查找默认时区并将其转换为ZoneId。如果更改了系统默认时区,则此方法的结果也将更改。
代码示例来源:origin: org.threeten/threetenbp
/**
* Obtains a clock that returns the current instant using the best available
* system clock, converting to date and time using the default time-zone.
* <p>
* This clock is based on the best available system clock.
* This may use {@link System#currentTimeMillis()}, or a higher resolution
* clock if one is available.
* <p>
* Using this method hard codes a dependency to the default time-zone into your application.
* It is recommended to avoid this and use a specific time-zone whenever possible.
* The {@link #systemUTC() UTC clock} should be used when you need the current instant
* without the date or time.
* <p>
* The returned implementation is immutable, thread-safe and {@code Serializable}.
* It is equivalent to {@code system(ZoneId.systemDefault())}.
*
* @return a clock that uses the best available system clock in the default zone, not null
* @see ZoneId#systemDefault()
*/
public static Clock systemDefaultZone() {
return new SystemClock(ZoneId.systemDefault());
}
代码示例来源:origin: ThreeTen/threetenbp
/**
* Obtains a clock that returns the current instant using the best available
* system clock, converting to date and time using the default time-zone.
* <p>
* This clock is based on the best available system clock.
* This may use {@link System#currentTimeMillis()}, or a higher resolution
* clock if one is available.
* <p>
* Using this method hard codes a dependency to the default time-zone into your application.
* It is recommended to avoid this and use a specific time-zone whenever possible.
* The {@link #systemUTC() UTC clock} should be used when you need the current instant
* without the date or time.
* <p>
* The returned implementation is immutable, thread-safe and {@code Serializable}.
* It is equivalent to {@code system(ZoneId.systemDefault())}.
*
* @return a clock that uses the best available system clock in the default zone, not null
* @see ZoneId#systemDefault()
*/
public static Clock systemDefaultZone() {
return new SystemClock(ZoneId.systemDefault());
}
代码示例来源:origin: XeroAPI/Xero-Java
public OffsetDateTime deserialize(JsonParser jsonparser, DeserializationContext context)
throws IOException, JsonProcessingException {
String date = jsonparser.getText();
OffsetDateTime formattedDate;
Pattern datePatt = Pattern.compile("^/Date\\((\\d+)([+-]\\d+)?\\)/$");
Matcher m = datePatt.matcher(date);
if (m.matches()) {
Long l = Long.parseLong(m.group(1));
formattedDate = Instant.ofEpochMilli(l).atZone(ZoneId.systemDefault()).toOffsetDateTime();
} else {
throw new IllegalArgumentException("Wrong date format");
}
return formattedDate;
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public LocalDateTime convert(Date source) {
return ofInstant(toInstant(source), systemDefault());
}
}
代码示例来源:origin: XeroAPI/Xero-Java
public LocalDate deserialize(JsonParser jsonparser, DeserializationContext context)
throws IOException, JsonProcessingException {
String date = jsonparser.getText();
LocalDate formattedDate;
Pattern datePatt = Pattern.compile("^/Date\\((\\d+)([+-]\\d+)?\\)/$");
Matcher m = datePatt.matcher(date);
if (m.matches()) {
Long l = Long.parseLong(m.group(1));
formattedDate = Instant.ofEpochMilli(l).atZone(ZoneId.systemDefault()).toLocalDate();
} else {
throw new IllegalArgumentException("Wrong date format");
}
return formattedDate;
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public LocalTime convert(Date source) {
return ofInstant(ofEpochMilli(source.getTime()), systemDefault()).toLocalTime();
}
}
代码示例来源:origin: jeffdcamp/dbtools-android
@Nullable
public static Long localDateTimeToLong(@Nullable LocalDateTime d) {
if (d == null) {
return null;
}
return d.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
}
代码示例来源:origin: jeffdcamp/dbtools-android
@Nullable
public static LocalDateTime longToLocalDateTime(@Nullable Long l) {
if (l == null) {
return null;
}
return Instant.ofEpochMilli(l).atZone(ZoneId.systemDefault()).toLocalDateTime();
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public LocalDate convert(Date source) {
return ofInstant(ofEpochMilli(source.getTime()), systemDefault()).toLocalDate();
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public Date convert(LocalDateTime source) {
return toDate(source.atZone(systemDefault()).toInstant());
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public Date convert(LocalDate source) {
return toDate(source.atStartOfDay(systemDefault()).toInstant());
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public Date convert(Instant source) {
return toDate(source.atZone(systemDefault()).toInstant());
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public java.time.LocalDateTime convert(LocalDateTime source) {
Date date = toDate(source.atZone(ZoneId.systemDefault()).toInstant());
return Jsr310Converters.DateToLocalDateTimeConverter.INSTANCE.convert(date);
}
}
代码示例来源:origin: Krillsson/sys-API
default java.util.Date map(org.threeten.bp.LocalDate value) {
return value != null ? DateTimeUtils.toDate(value.atStartOfDay(ZoneId.systemDefault()).toInstant()) : null;
}
}
代码示例来源:origin: riggaroo/android-things-electricity-monitor
private Duration getDifferenceBetweenTimeAndNow(long timeStart) {
LocalDateTime today = LocalDateTime.now();
LocalDateTime otherTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timeStart), ZoneId.systemDefault());
return Duration.between(otherTime, today);
}
代码示例来源:origin: gabrielittner/lazythreetenbp
/**
* Call on background thread to eagerly load all zones. Starts with loading
* {@link ZoneId#systemDefault()} which is the one most likely to be used.
*/
@WorkerThread
public static void cacheZones() {
ZoneId.systemDefault().getRules();
for (String zoneId : ZoneRulesProvider.getAvailableZoneIds()) {
ZoneRulesProvider.getRules(zoneId, true);
}
}
代码示例来源:origin: apache/servicemix-bundles
@Nonnull
@Override
public Date convert(LocalTime source) {
return toDate(source.atDate(LocalDate.now()).atZone(systemDefault()).toInstant());
}
}
我在某些摩托罗拉设备上有一个非常奇怪的行为,其中 LocalDateTime.now() 返回 0000-00-00T00:00:00.0 和 ThreeTenABP . 代码如下: @Overrid
本文整理了Java中org.threeten.bp.ZoneId类的一些代码示例,展示了ZoneId类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从
本文整理了Java中org.threeten.bp.ZonedDateTime类的一些代码示例,展示了ZonedDateTime类的具体用法。这些代码示例主要来源于Github/Stackoverfl
本文整理了Java中org.threeten.bp.ZoneOffset类的一些代码示例,展示了ZoneOffset类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Mav
本文整理了Java中org.threeten.bp.YearMonth类的一些代码示例,展示了YearMonth类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven
本文整理了Java中org.threeten.bp.Year类的一些代码示例,展示了Year类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选
本文整理了Java中org.threeten.extra.YearQuarter类的一些代码示例,展示了YearQuarter类的具体用法。这些代码示例主要来源于Github/Stackoverflo
我正在使用 ThreeTen 并尝试格式化 Instant。拆分它会更容易,但我很好奇,这应该有效吗?从我读过的所有内容来看,Instant 应该是可解析的,并且具有模式的所有组件: @Test pu
这个痕迹对任何人来说都很眼熟吗?它只发生在少数设备上。 ThreeTenBP 是依赖中的依赖。 10:16:33 E AndroidRuntime : java.util.ServiceConfigu
本文整理了Java中org.threeten.bp.ZoneId.of()方法的一些代码示例,展示了ZoneId.of()的具体用法。这些代码示例主要来源于Github/Stackoverflow/M
本文整理了Java中org.threeten.bp.ZonedDateTime.from()方法的一些代码示例,展示了ZonedDateTime.from()的具体用法。这些代码示例主要来源于Gith
本文整理了Java中org.threeten.bp.zone.ZoneRulesProvider类的一些代码示例,展示了ZoneRulesProvider类的具体用法。这些代码示例主要来源于Githu
本文整理了Java中org.threeten.bp.zone.ZoneRules类的一些代码示例,展示了ZoneRules类的具体用法。这些代码示例主要来源于Github/Stackoverflow/
本文整理了Java中org.threeten.bp.ZoneOffset.of()方法的一些代码示例,展示了ZoneOffset.of()的具体用法。这些代码示例主要来源于Github/Stackov
本文整理了Java中org.threeten.bp.YearMonth.of()方法的一些代码示例,展示了YearMonth.of()的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中org.threeten.bp.Year.of()方法的一些代码示例,展示了Year.of()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven
本文整理了Java中org.threeten.bp.zone.ZoneRulesInitializer类的一些代码示例,展示了ZoneRulesInitializer类的具体用法。这些代码示例主要来源
本文整理了Java中org.threeten.bp.zone.ZoneOffsetTransition类的一些代码示例,展示了ZoneOffsetTransition类的具体用法。这些代码示例主要来源
本文整理了Java中org.threeten.bp.zone.ZoneOffsetTransitionRule类的一些代码示例,展示了ZoneOffsetTransitionRule类的具体用法。这些
我使用 this library用于在我的应用程序中存储日期和时间相关数据。当应用程序启动时,AndroidThreeTen 首先被初始化以正常运行。所以想问下单元测试的时候怎么初始化呢?例如。我想使
我是一名优秀的程序员,十分优秀!