public class DateTimeService extends Object
| Modifier and Type | Field and Description |
|---|---|
static Supplier<org.joda.time.DateTime> |
now |
| Constructor and Description |
|---|
DateTimeService() |
| Modifier and Type | Method and Description |
|---|---|
static org.joda.time.DateTime |
current24HourTimeSlice()
The 24 hour time slices are fix - 00:00 to 24:00.
|
static org.joda.time.DateTime |
currentHour() |
static org.joda.time.DateTime |
currentMinute() |
static org.joda.time.DateTime |
get24HourTimeSlice(org.joda.time.DateTime time)
This method determines the 24 hour time slice for the specified time and returns the start of that time slice.
|
static org.joda.time.DateTime |
getTimeSlice(org.joda.time.DateTime dt,
org.joda.time.Duration duration) |
static long |
getTimeSlice(long time,
org.joda.time.Duration duration) |
static TemporalAdjuster |
startOfNextOddHour() |
static TemporalAdjuster |
startOfPreviousEvenHour() |
public static Supplier<org.joda.time.DateTime> now
public static org.joda.time.DateTime currentMinute()
public static org.joda.time.DateTime currentHour()
public static org.joda.time.DateTime current24HourTimeSlice()
currentHour() and returns the start of the time slice.public static org.joda.time.DateTime get24HourTimeSlice(org.joda.time.DateTime time)
time - The DateTime to be rounded downcurrent24HourTimeSlice()public static long getTimeSlice(long time,
org.joda.time.Duration duration)
public static org.joda.time.DateTime getTimeSlice(org.joda.time.DateTime dt,
org.joda.time.Duration duration)
public static TemporalAdjuster startOfNextOddHour()
public static TemporalAdjuster startOfPreviousEvenHour()
Copyright © 2014–2017 Red Hat, Inc.. All rights reserved.