public class DateHelper extends Object
| Constructor and Description |
|---|
DateHelper() |
| Modifier and Type | Method and Description |
|---|---|
int |
getDayOfWeekIndex(LocalDateTime time)
get day of week
|
int |
getDayOfWeekIndex(String day)
get day of week
|
LocalDateTime |
getLocalDateTime(String timeString)
get local date time from date string
|
int |
getMonthOfYearIndex(LocalDateTime time)
get month of year
|
int |
getMonthOfYearIndex(String month)
get month of year
|
String |
getTime(Instant time,
String format)
get time based on format
|
String |
getTime(String format)
get current time based on format
|
String |
getTime(String format,
String zone)
get current time based on format and time zone
|
String |
getTime(String timeString,
String format,
String zone)
get time based on format and time zone
|
String |
getTimeInstance() |
String |
getTimeISOInstant() |
String |
getTimestampMiliseconds() |
String |
getTimestampSeconds() |
boolean |
isBetweenDates(List<String> sources,
String date1,
String date2)
are source dates between date1 and date2
|
boolean |
isBetweenDates(String source,
String date1,
String date2)
is source date between date1 and date2
|
String |
setTimeParameterFormat(String parameter)
reorders time zone and format
zone and format will come at the end
eg.
|
public String getTimestampMiliseconds()
public String getTimeInstance()
public String getTimestampSeconds()
public String getTimeISOInstant()
public String getTime(String format, String zone)
format - zone - public String getTime(String format)
format - public String getTime(Instant time, String format)
time - format - public String getTime(String timeString, String format, String zone)
time - format - zone - public int getDayOfWeekIndex(String day)
day - public int getDayOfWeekIndex(LocalDateTime time)
time - public int getMonthOfYearIndex(String month)
time - public int getMonthOfYearIndex(LocalDateTime time)
time - public boolean isBetweenDates(String source, String date1, String date2)
source - date1 - date2 - public boolean isBetweenDates(List<String> sources, String date1, String date2)
sources - date1 - date2 - public LocalDateTime getLocalDateTime(String timeString)
timeString - public String setTimeParameterFormat(String parameter)
value - Copyright © 2020. All rights reserved.