[ANSWERED]Getting the day of the week into a variable

Posted on
Mon Jul 21, 2014 9:34 pm
HowmaNoid offline
User avatar
Posts: 67
Joined: Apr 14, 2012

[ANSWERED]Getting the day of the week into a variable

Is there anyway to get the system day (i.e. Monday, Tuesday, etc) into a viable in Indigo so it can later be spoken in an action? I've been able to get the numeric data into a variable but I really need to name of the day of the week.

Thanks in avance!

H

Posted on
Mon Jul 21, 2014 10:16 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Getting the day of the week into a variable

The easiest way (to me) is to use Python's DateTime format string; you can use a "%A" to get the day representation as a string. You can do this in a script or use the built-in action "Insert Timestamp into Variable" in the Variable Actions section (in that case, check to use a custom format and use %A).

I haven't tested this in the Actions, but have used it in Python scripts, should work the same in both places.

Adam

Posted on
Mon Jul 21, 2014 11:12 pm
HowmaNoid offline
User avatar
Posts: 67
Joined: Apr 14, 2012

Re: Getting the day of the week into a variable

That solved it!

Thanks

H

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron