Issue with Time await and conditional dateParts

117 views
Skip to first unread message

Mauro

unread,
Sep 8, 2026, 3:40:06 AMSep 8
to Automate for Android
I'm trying to use Time await with a conditional dateParts, so that the starting date is the day after when it triggers unless it's Sunday, case in which the starting date is the next Monday.

I'm trying this:

photo_2026-09-08_09-22-42.jpg

the idea being that if tomorrow (Now + 24 * 3600) is Sunday, then the day/month/year is two days later (dateParts(Now + 48 * 3600)), otherwise is tomorrow (dateParts(Now + 24 * 3600)); when I run it, I get this error:

jawa.lang.IllegalStateException: Start time not found

and I can't understand what's the issue, also because each part runs without error (if I use only day, month or hear), I get the error only if I use all three of them; if I run it only with day and month, no error.

Henrik "The Developer" Lindqvist

unread,
Sep 9, 2026, 10:08:25 AMSep 9
to Automate for Android
Try logging the three expressions to ensure they actually produce the expected values.

Mauro

unread,
Sep 11, 2026, 9:17:39 AMSep 11
to Automate for Android
I tried, the log looks right: launched today the output is 12 8 2026, so tomorrow. 

Beebo

unread,
Sep 11, 2026, 11:08:41 AMSep 11
to Automate for Android
There are missing parentheses in the months expression. The binary shift is being done with the first dateParts function instead of the output of the conditional operator.

Also as a tip, you are currently creating the same date array multiple times in a row. Assigning them to two variables (tomorrow, the day after) simplifies the expressions a bit.

Mauro

unread,
Sep 11, 2026, 12:22:54 PMSep 11
to Automate for Android
So I should put everything after 1 << inside parentheses? I'll try, thanks; if that's the issue, any idea why it seems to work if I don't use the year, while it breaks if I use it?

Henrik "The Developer" Lindqvist

unread,
Sep 11, 2026, 1:38:44 PMSep 11
to Automate for Android
Months should be 0x100 or 256 for September, since it's a bitmask, not 8.
Try putting parentheses around the right hand side operand in the left shift, i.e. 1 << (...)

On Friday, September 11, 2026 at 3:17:39 PM UTC+2 Mauro wrote:

Beebo

unread,
Sep 11, 2026, 2:15:47 PMSep 11
to Automate for Android
With the month set to 8 (April), and the year to 2026, the block was set to await a date in the past, so errors out. Without the year, it was just waiting for the next April.

Rico Sangkaan

unread,
Sep 18, 2026, 9:38:24 PMSep 18
to automa...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Automate for Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automate-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/automate-user/cb816575-4ade-4523-a1c1-83a41d924f6an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages