timeTodayAfter() method

Hi,

I am using the timeTodayAfter() method as:

def t = timeTodayAfter(new Date(), time.format("HH:mm", getTimeZone()), getTimeZone())

but I get an exception :

groovy.lang.MissingMethodException: No signature of method: user_app_alyc100_Neato__Connect__129.timeTodayAfter() is applicable for argument types: (java.util.Date, java.lang.String, sun.util.calendar.ZoneInfo) values: [Sun Mar 21 23:30:10 MSK 2021, 00:01, sun.util.calendar.ZoneInfo[id="Europe/Moscow",offset=10800000,dstSavings=0,useDaylight=false,transitions=79,lastRule=null]] on line 1264 (updated)

here , it seems like I am using it with correct parameters:

https://docs.hubitat.com/index.php?title=Common_Methods_Object

"Date timeTodayAfter(String startTimeString, String timeString, TimeZone timeZone = null) (Common method since 2.1.0)"

so, what am I missing ?

It wants (String, String, TZ) you’re giving it (Date, String, TZ)

1 Like

ok Thanks.

but what format the string should be ?

is it ok if I convert it to string with something like toString() ?

or would something like this:

Date date = new Date()
String strDate = date.format( 'dd-MM-yyyy HH:mm:ss' )

?

timeTodayAfter()

Gets a Date object for the specified input that is guaranteed to be after the specified starting date.

Signature:

Date timeTodayAfter(String startTimeString, String timeString [, TimeZone timeZone])

Parameters:

String startTimeString - The time for which the returned date must be after. Can be an ISO-8601 date string as returned from time input preferences, or a simple time string in "hh:mm" format (β€œ21:34”).

String timeString - The time string to get the date object for. Can be an ISO-8601 date string as returned from time input preferences, or a simple time string in "hh:mm" format (β€œ21:34”).

TimeZone timeZone (optional) - The time zone used for determining the current date and time.

1 Like

thanks. where can I find this documentation ?

I changed the code as:

    Date d1 = new Date()
	def t = timeTodayAfter(d1.format("HH:mm", getTimeZone()), time.format("HH:mm", getTimeZone()), getTimeZone())
	//def t = timeTodayAfter(new Date(), time.format("HH:mm", getTimeZone()), getTimeZone())

Many of the methods are similar to the Classic ST methods, so if I have a question that isn’t answered by the Hubitat documentation, I pull those up (I may/or may not have made a local copy some years ago); many times a quick Google search for the method will bring up the ST Classic documentation.

1 Like