Insert ISO week in variable

Posted on
Thu Apr 21, 2016 7:19 am
Uncle Grey offline
Posts: 2
Joined: Apr 21, 2016
Location: Sweden

Insert ISO week in variable

How can I insert week number in a variable with Python?

Posted on
Thu Apr 21, 2016 7:41 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Insert ISO week in variable

Something like this should work:

Code: Select all
from datetime import datetime, time
now         = datetime.now()
calendar    = datetime.isocalendar(now)
iso_week    = str(calendar[1])
indigo.variable.updateValue(VARIABLE_ID, iso_week)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Apr 21, 2016 11:20 am
Uncle Grey offline
Posts: 2
Joined: Apr 21, 2016
Location: Sweden

Re: Insert ISO week in variable

Thanks!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests

cron