object DateUtils
DateUtil
- Alphabetic
- By Inheritance
- DateUtils
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
datePattern: Regex
Regex that matches date with the following format:
Regex that matches date with the following format:
yyyy-MM-dd
-
val
datetimePattern: Regex
Regex that matches datetime with the following format:
Regex that matches datetime with the following format:
2018-01-01 00:00:45.100+0000
2018-01-01 00:00:45.100Z
2018-01-01T00:00:45Z
2018-01-01T00:00:45Z
2018-01-01T00:00:45
It doesn't check the validity of date, which means it can works on date like 9999-99-99 99:99:99
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getDateFromString(date: String, pattern: String = "yyyy-MM-dd", timeZone: String = "UTC"): Date
Parse a given date string with the given pattern to a java.sql.Date object
Parse a given date string with the given pattern to a java.sql.Date object
- date
date string
- pattern
format of the given date string
- timeZone
time zone of the given date string
-
def
getDatetimeFromString(date: String, pattern: String = "yyyy-MM-dd HH:mm:ss", timeZone: String = "UTC"): Timestamp
Parse a given date string with the given pattern to a java.sql.Timestamp object
Parse a given date string with the given pattern to a java.sql.Timestamp object
- date
date string
- pattern
format of the given date string
- timeZone
time zone of the given date string
-
def
getFirstMinuteOfHour(date: String, pattern: String = "yyyy-MM-dd HH:mm:ss", timeZone: String = "UTC"): Timestamp
Parse and round a given date string with the given pattern to a java.sql.Timestamp object
Parse and round a given date string with the given pattern to a java.sql.Timestamp object
- date
date string
- pattern
format of the given date string
- timeZone
time zone of the given date string
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
reformatDateTimeString(input: String, withTime: Boolean, end: Boolean): String
From a given date or datetime string, retrieve the correct date format (with or without time)
From a given date or datetime string, retrieve the correct date format (with or without time)
Note: the maximum precision is 1 second
- input
your date/datetime string
- withTime
true to return a datetime, false to return only a date
- end
true to return the last seconds of the given date, false to return the first second (this only takes effect when there is no time in the given input)
- Annotations
- @throws( ... )
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()