can %DAYW display a future weekday?

89 views
Skip to first unread message

Logan Fury

unread,
May 8, 2017, 10:08:27 AM5/8/17
to Tasker
Hello, 

Im working on a project where everyday its going to give information for the next 3 days, and im trying to create dynamic headers of weekday names ( Monday, Tuesday, Wednesday - Tuesday, Wednesday, Thursday etc) that change properly every day.

Is there a way to command %DAYW to display what it would be in 24, 48, and 72 hours from the time script was run, respectively?

Thank you for reading,

Logan

Pent

unread,
May 8, 2017, 10:17:12 AM5/8/17
to Tasker
You would add some seconds to %TIMES (e.g. 86400 for a day in
the future) and plug the resulting value into Variable Convert, Seconds To ...,
Then Variable Split to get the day name.

There are other ways too.

Pent

Logan Fury

unread,
May 8, 2017, 10:19:07 AM5/8/17
to tas...@googlegroups.com
Thank you very much Pent, Ill start experimenting with those commands right away.

Appreciate the fast reply :)

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/YZFBYNKHQ68/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Logan Fury

unread,
May 8, 2017, 10:32:45 AM5/8/17
to tas...@googlegroups.com
Got it. Thank you very much. Was this a good way to execute this or was there a more elegant method?

Weekday Test (563)
A1: Flash [ Text:Today is: %DAYW Long:Off ] 
A2: Variable Set [ Name:%dayone To:%TIMES+86400 Recurse Variables:Off Do Maths:On Append:Off ] 
A3: Variable Convert [ Name:%dayone Function:Seconds to Long Date Time Store Result In: ] 
A4: Variable Split [ Name:%dayone Splitter:, Delete Base:Off ] 
A5: Flash [ Text:Tomorrow is: %dayone1 Long:Off ] 
A6: Variable Set [ Name:%daytwo To:%TIMES+172800 Recurse Variables:Off Do Maths:On Append:Off ] 
A7: Variable Convert [ Name:%daytwo Function:Seconds to Long Date Time Store Result In: ] 
A8: Variable Split [ Name:%daytwo Splitter:, Delete Base:Off ] 
A9: Flash [ Text:The day after is: %daytwo1 Long:Off ]

Pent

unread,
May 8, 2017, 10:49:57 AM5/8/17
to Tasker
Very good, I think you're starting to get the hang of things :-)

Pent

Pent

unread,
May 8, 2017, 10:50:44 AM5/8/17
to Tasker
For bonus points, put the logic in a separate task, and use
Perform Task with a return variable to get the answer for
each day in one action :-)

Pent

Logan Fury

unread,
May 8, 2017, 10:55:55 AM5/8/17
to tas...@googlegroups.com
"I think you're starting to get the hang of things :-)"

I have you and the wonderful coders populating your forum to thank for that!

Ill have to study the details of return variable. Youre suggesting I have a single %TIMES+86400 and running it repeatedly for the number of days in the future necessary?



Pent

unread,
May 8, 2017, 11:51:06 AM5/8/17
to Tasker


Ill have to study the details of return variable. Youre suggesting I have a single %TIMES+86400 and running it repeatedly for the number of days in the future necessary?

No, call the task with the number of days desired, task returns the weekday. The calculation is %TIMES + (86400 * %nodays).

Pent

Logan Fury

unread,
May 8, 2017, 11:59:59 AM5/8/17
to tas...@googlegroups.com
ok I understand, thank you for the demonstration Pent

--

Rich D

unread,
May 8, 2017, 1:22:49 PM5/8/17
to Tasker Google Groups Post

Nice work...  you should use a for loop to save on some actions...  here is a cheat sheet for your extra credit...

Rich D

unread,
May 8, 2017, 1:26:00 PM5/8/17
to Tasker Google Groups Post

Get Next Day Names (435)
A1: For [ Variable:%index Items:1:%par1 ]
A2: Variable Set [ Name:%day_name To:%TIMES+(86400*%index) Recurse Variables:Off Do Maths:On Append:Off ]
A3: Variable Convert [ Name:%day_name Function:Seconds to Long Date Time Store Result In: ]
A4: Variable Split [ Name:%day_name Splitter:, Delete Base:Off ]
A5: Variable Set [ Name:%all_day_names(%index) To:%day_name1 Recurse Variables:Off Do Maths:Off Append:Off ]
A6: End For
A7: Return [ Value:%all_day_names() Stop:Off ]

Main_Task (436)
A1: Perform Task [ Name:Get Next Day Names Priority:%priority+1 Parameter 1 (%par1):3 Parameter 2 (%par2): Return Value Variable:%next_day_names Stop:Off ]
A2: Flash [ Text:%next_day_names Long:Off ]

This will give you a comma separated list of the requested number of day names in %next_day_names

Logan Fury

unread,
May 8, 2017, 1:28:43 PM5/8/17
to tas...@googlegroups.com
Your ears must have been burning, I was just talking about my favorite teachers!

Thank you for the code Rich, thats going to be very helpful.

--

George Boyce

unread,
May 8, 2017, 8:50:10 PM5/8/17
to Tasker
You've got a lot more people than you think watching you build this behemoth of a project, Logan.

You're even getting "private" lessons from "The Creator" himself now. An honour, indeed! :)

Logan Fury

unread,
May 8, 2017, 8:52:15 PM5/8/17
to tas...@googlegroups.com
My only wish is that I dont repay everyones time by losing control of this script and watching it stomp off to eat Detroit....

On Mon, May 8, 2017 at 5:50 PM, George Boyce <ceria...@gmail.com> wrote:
You've got a lot more people than you think watching you build this behemoth of a project, Logan.

You're even getting "private" lessons from "The Creator" himself now. An honour, indeed! :)

--

Pent

unread,
May 9, 2017, 1:38:13 AM5/9/17
to Tasker

You've got a lot more people than you think watching you build this behemoth of a project, Logan.

You're even getting "private" lessons from "The Creator" himself now. An honour, indeed! :)

You managed to build quite a lot of irony into that post :-)

Pent

George Boyce

unread,
May 9, 2017, 7:02:51 AM5/9/17
to Tasker


On Tuesday, 9 May 2017 06:38:13 UTC+1, Pent wrote:

You managed to build quite a lot of irony into that post :-)

Pent

Yup! ;-)
Reply all
Reply to author
Forward
0 new messages