List of Date interface functions
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
DATEFORMAT_DEFAULT |
Type | Name and description |
---|---|
java.util.Date |
addTime(java.util.Date attribute, java.lang.Integer timeToAdd, java.lang.String timeUnit) Add time units to a date |
java.lang.Double |
diffDates(java.util.Date attribute1, java.util.Date attribute2, java.lang.String timeUnit = UserFunctions.MILLISECONDS, java.lang.Boolean precisionFlag = false) Get the difference between the two dates based on the time unit specified |
java.lang.Integer |
getDayOfMonth(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the day of month information from the date based on the timezone and locale as optional parameters |
java.lang.Integer |
getDayOfWeek(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the day of week information from the date based on the timezone and locale as optional parameters |
java.lang.Integer |
getDayOfYear(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the day of year information from the date based on the timezone and locale as optional parameters |
java.lang.Integer |
getHour(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the hour information from the date based on the timezone and locale as optional parameters |
java.lang.Long |
getMilliSecond(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the milliseconds information from the date based on the timezone and locale as optional parameters |
java.lang.Integer |
getMinute(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the minute information from the date based on the timezone and locale as optional parameters |
java.lang.Integer |
getMonth(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the month information from the date based on the timezone and locale as optional parameters |
java.lang.Long |
getSeconds(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the seconds information from the date based on the timezone and locale as optional parameters |
java.lang.Integer |
getYear(java.util.Date attribute, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Get the year information from the date based on the timezone and locale as optional parameters |
java.lang.Boolean |
isDate(java.lang.String attribute, java.lang.String dataFormatInfo = null) Convert a string to a date based on the date format |
java.util.Date |
toDate(java.lang.Long epochDate) Convert a long to a date |
java.util.Date |
toDate(java.lang.String attribute, java.lang.String dataFormatInfo = DATEFORMAT_DEFAULT, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Convert a string to a date based on given date format |
java.lang.String |
toString(java.util.Date attribute, java.lang.String dataFormatInfo = DATEFORMAT_DEFAULT, java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Convert date to string |
java.util.Date |
today(java.lang.String timezoneInfo = null, java.lang.String localeInfo = "en") Return the current date |
java.util.Date |
truncateDate(java.util.Date attribute, java.lang.String timeUnit) Truncate Date based on the time unit |
Methods inherited from class | Name |
---|---|
class ConversionFunctions |
toBoolean, toBoolean, toBoolean, toDate, toDouble, toDouble, toDouble, toLong, toLong, toLong, toLong, toString |
class EnrichmentFunctions |
detectLanguage, extractKeyPhrases, extractNounGroups, extractWhitelistTags, geotagIPAddress, geotagIPAddressGetGeocode, geotagStructuredAddress, geotagUnstructuredAddress, geotagUnstructuredAddressGetGeocode, getEntities, getSentiment, getTermSentiment, reverseGeotag, runExternalPlugin, stripTagsFromHTML, toPhoneticHash |
class groovy.lang.Script |
groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(long), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() |
Add time units to a date
timeUnit
- timeUnit can be MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARSGet the difference between the two dates based on the time unit specified
timeUnit
- timeUnit can be MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARSprecisionFlag
- whether or not to diff with millisecond precisionGet the day of month information from the date based on the timezone and locale as optional parameters
Get the day of week information from the date based on the timezone and locale as optional parameters
Get the day of year information from the date based on the timezone and locale as optional parameters
Get the hour information from the date based on the timezone and locale as optional parameters
Get the milliseconds information from the date based on the timezone and locale as optional parameters
Get the minute information from the date based on the timezone and locale as optional parameters
Get the month information from the date based on the timezone and locale as optional parameters
Get the seconds information from the date based on the timezone and locale as optional parameters
Get the year information from the date based on the timezone and locale as optional parameters
Convert a string to a date based on the date format
Convert a long to a date
Convert a string to a date based on given date format
Convert date to string
Return the current date
Truncate Date based on the time unit
timeUnit
- timeUnit can be MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS or YEARS