public class DateLocaling extends Object
| Constructor and Description |
|---|
DateLocaling() |
| Modifier and Type | Method and Description |
|---|---|
static LocalDateTime |
fromZone(LocalDateTime time,
ZoneId from)
把time从来源时区变为系统时区
|
static LocalDate |
nowDate(ZoneId to) |
static LocalDateTime |
nowDateTime(ZoneId to) |
static LocalTime |
nowTime(ZoneId to) |
static LocalDateTime |
pastMonday(ZoneId to)
当前或过去的周一的 0:0:0.0
|
static LocalDateTime |
pastSunday(ZoneId to)
当前或过去的周日的 0:0:0.0
|
static LocalDateTime |
pastWeek(ZoneId to,
DayOfWeek day)
当前或过去的周几的 0:0:0.0
|
static LocalDateTime |
thisMonth(ZoneId to)
月初的 0:0:0.0
|
static LocalDateTime |
today(ZoneId to)
今天的 0:0:0.0
|
static LocalDateTime |
toZone(LocalDateTime time,
ZoneId to)
把time从系统时区变为 to的时区
|
static LocalDateTime |
toZone(LocalDateTime time,
ZoneId from,
ZoneId to)
把时间从from变为to时区
|
static LocalDateTime |
toZone(ZonedDateTime time,
ZoneId to)
把时间变为to时区
|
static ZonedDateTime |
zoneZone(ZonedDateTime time,
ZoneId to)
把同一时间不同时区
|
public static LocalDateTime nowDateTime(ZoneId to)
public static LocalDateTime today(ZoneId to)
to - 时区public static LocalDateTime thisMonth(ZoneId to)
to - 时区public static LocalDateTime pastMonday(ZoneId to)
to - 时区public static LocalDateTime pastSunday(ZoneId to)
to - 时区public static LocalDateTime pastWeek(ZoneId to, DayOfWeek day)
to - 时区day - 星期public static LocalDateTime fromZone(LocalDateTime time, ZoneId from)
time - 时间from - 来源时区public static LocalDateTime toZone(LocalDateTime time, ZoneId to)
time - 时间to - 目标时区public static LocalDateTime toZone(LocalDateTime time, ZoneId from, ZoneId to)
time - 时间from - 来源to - 目标public static LocalDateTime toZone(ZonedDateTime time, ZoneId to)
time - 时间to - 目标时区public static ZonedDateTime zoneZone(ZonedDateTime time, ZoneId to)
time - 时间to - 目标时区Copyright © 2020. All rights reserved.