Package jp.vmi.selenium.selenese.utils
Class DateTimeUtils
java.lang.Object
jp.vmi.selenium.selenese.utils.DateTimeUtils
public final class DateTimeUtils extends Object
Date and time utilities.
-
Method Summary
Modifier and Type Method Description static StringformatIso8601(long time)Format time as ISO8601.static StringformatTimeWithMS(long time)Format time (hour, minute, second and millisecond).static StringformatWithMS(long time)Format date time with milli secconds.static StringformatWithoutMS(long time)Format date time without milli secconds.static TemporalAccessorparseIso8601(String timeStr)Parse time string as ISO8601.static voidsetFormat(String ymd, String sep1, String hms, String ms, String sep2, String tz)Set date and time format.
-
Method Details
-
setFormat
public static void setFormat(String ymd, String sep1, String hms, String ms, String sep2, String tz)Set date and time format.- Parameters:
ymd- format of year, month and day.sep1- separator between ymd and hms.hms- format of hour, minulte and second.ms- format of millisecond.sep2- separator between hms and tz.tz- timezone.
-
formatWithMS
Format date time with milli secconds.- Parameters:
time- time of UTC.- Returns:
- formatted date time with milli seconds.
-
formatWithoutMS
Format date time without milli secconds.- Parameters:
time- time of UTC.- Returns:
- formatted date time without milli seconds.
-
formatTimeWithMS
Format time (hour, minute, second and millisecond).- Parameters:
time- time of UTC.- Returns:
- formatted time.
-
formatIso8601
Format time as ISO8601. "yyyy-MM-dd'T'HH:mm:ssXXX" to "2019-04-13T14:19:46+09:00".- Parameters:
time- time of UTC.- Returns:
- formatted time.
-
parseIso8601
Parse time string as ISO8601. parse "2019-04-13T14:19:46+09:00".- Parameters:
timeStr- string of time.- Returns:
- parsed time.
-