Servicely Administration
Scripting
DateTime API
1 min
constructor description datetime() current date, with default locale and time zone datetime(\<datetime>) clone from an existing datetime object datetime(\<string date>) attempt to parse the date using the default format datetime(\<string date>, \<date format>) attempt to parse the date using the specified format method description withyear(year int) datetime sets the datetime object with the year that was passed in as the parameter withmonthofyear(month int) datetime sets the datetime object with the month that was passed in as a parameter withdayofmonth(day int) datetime sets the datetime object with the day that was passed in as a parameter withhourofday(hour int) datetime sets the datetime object with the hour that was passed in as a parameter withminuteofhour(minute int) datetime sets the datetime object with the minute that was passed in as a parameter withsecondofminute(second int) datetime sets the datetime object with the second that was passed in as a parameter withmillisofsecond(millis int) datetime sets the datetime object with the milliseconds that was passed in as a parameter plusyears(years int) datetime adds the number of years passed in as a parameter to the current datetime plusmonths(months int) datetime adds the number of months passed in as a parameter to the current datetime plusdays(days int) datetime adds the number of days passed in as a parameter to the current datetime plushours(hours int) datetime adds the number of hours passed in as a parameter to the current datetime plusminutes(minutes int) datetime adds the number of minutes passed in as a parameter to the current datetime plusseconds(seconds int) datetime adds the number of seconds passed in as a parameter to the current datetime plusmillis(millis int) datetime adds the number of milliseconds passed in as a parameter to the current datetime minusyears(years int) datetime subtracts the number of years passed in as a parameter to the current datetime minusmonths(months int) datetime subtracts the number of months passed in as a parameter to the current datetime minusdays(days int) datetime subtracts the number of days passed in as a parameter to the current datetime minushours(hours int) datetime subtracts the number of hours passed in as a parameter to the current datetime minusminutes(minutes int) datetime subtracts the number of minutes passed in as a parameter to the current datetime minusseconds(seconds int) datetime subtracts the number of seconds passed in as a parameter to the current datetime minusmillis(millis int) datetime subtracts the number of milliseconds passed in as a parameter to the current datetime getyear() int gets the year of the current datetime object getmonthofyear() int gets the month of the current datetime object getdayofmonth() int gets the day of the current datetime object gethourofday() int gets the hour of the current datetime object getminuteofhour() int gets the minute of the current datetime object getsecondofminute() int gets the second of the current datetime object getmillisofsecond() int gets the millisecond of the current datetime object isafter(datetime datetime) boolean determines if the datetime object is after the datetime object passed in isbefore(datetime datetime) boolean determines if the datetime object is before the datetime object passed in isequal(datetime datetime) boolean determines if the datetime object is the same the datetime object passed in isafterorequalto(datetime datetime) boolean determines if the datetime object is after or equal to the datetime object passed in isbeforeorequalto(datetime datetime) boolean determines if the datetime object is before or equal to the datetime object passed in withtimeatstartofday() datetime sets the datetime object to the time of the start of the day issameday(datetime datetime) boolean determines if the datetime object is the same day as the datetime object passed in withdate(year int, month int, day int) datetime sets the datetime object passed on the parameters withtime(hour number, second number, milli number) datetime sets the datetime object wit the time passed in as a parameter toisoformat() string gets the isoformat of the current datetime object toisoformatgmt() string gets the isoformat of the current datetime object in gmt tolocaldatetime(zone string) datetime converts a datetime (with an associated timezone) to the same local datetime on another timezone e g 01/jan/2020 10 00 gmt will become 01/jan/2020 10 00 in the target zone fromnow() string checks what the datetime object is in comparison of now withzone( zone string) datetime adds a timezone to the datetime object withlang( locale string) datetime adds a locale to the datetime object format(format string) string sets the format of the datetime object based on joda datetime