public class SecurityTime extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SecurityTime.Builder
Fluent API builder for
SecurityTime. |
| Modifier and Type | Method and Description |
|---|---|
static SecurityTime.Builder |
builder()
A new builder for this class.
|
static SecurityTime |
create()
Creates a new security time based on default time zone and current time.
|
static SecurityTime |
create(Config config)
Load an instance from configuration.
|
ZonedDateTime |
get()
Get current (or as configured) time.
|
public static SecurityTime.Builder builder()
public static SecurityTime create()
public static SecurityTime create(Config config)
Example:
# server-time server-time: # can shift time if needed (before explicit values are applied # shift-by-seconds: -1020 # # All of the following settings: # if configured, will override actual value, if not set, current value is used # # definition of a time zone (that is valid for ZoneId.of()) # this will move the time to the specific timezone (same instant) # Time zone is applied first, everything else after # time-zone: Europe/Prague time-zone: "Australia/Darwin" year: 2017 # 1 for January, 12 for December month: 9 # day of month (1 - 31) day-of-month: 6 # hour of day (0 - 23) hour-of-day: 13 # minute of hour (0 - 59) minute: 0 # second of minute (0-59) second: 0 # millisecond of minute (0-999) # millisecond: 0
config - configuration located on the key "server-time" in example above (the key name can differ, the content is
important)public ZonedDateTime get()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.