Twilight

Share and discuss your flows and ideas with other users.

Moderator: Martin

Post Reply
Elkanah
Posts: 7
Joined: 18 Feb 2018 07:39

Twilight

Post by Elkanah » 18 Feb 2018 20:25

Hi all

This is the first flow that I'm sharing
I just converted the NOAA code from the twilight.xls file you can find on the internet

I've checked it few times and it's working fine for me

You need to change two parameters
Both of theme under Twilight Base --> Split Date
The first one is timezone, just change it to whatever timezone you need
The second one is dlstime (day light saving time) where 0 is no and 1 is yes

At the end of the base flow it will check if the flow was executed automaticly or manualy

In case it is executed automaticly it will save the times to global variables
And if manually it will show a message box with all the details

Very important!!!
You can execute only the base flow
If you'll try to execute any other flow that included it will run into an error about null values

Hope you enjoy it :)

http://automagic4android.com/flow.php?i ... c6b82d3156

Best regards to all

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Twilight

Post by anuraag » 19 Jan 2020 01:35

Couldn't figure it out how to enter 0530 timezone.
Edit: got it. It will be 5.5

Edit2: following code can be used to set timezone and dlstime

Code: Select all

cal = callJavaStaticMethod("java.util.Calendar", "getInstance()");
callJavaMethod(cal, "java.util.Calendar", "setTimeInMillis(long)", value);

timezone = callJavaMethod(cal, "java.util.Calendar", "get(int)", getJavaStaticField("java.util.Calendar", "ZONE_OFFSET")) / 3600000.;

if (callJavaMethod(callJavaMethod(cal, "java.util.Calendar", "getTimeZone()"), "java.util.TimeZone", "inDaylightTime(java.util.Date)", callJavaConstructor("java.util.Date", "Date()")))
{dlstime = 1}
else {dlstime = 0}
Edit: I have created a script function using noaa excel and Win1Sec Variable used by Elkanah
Attachments
flow_Twilight_20200126_091810.xml
(7.37 KiB) Downloaded 1277 times
Last edited by anuraag on 26 Jan 2020 03:50, edited 2 times in total.

Brucedg
Posts: 1
Joined: 18 Jan 2020 15:45

Re: Twilight

Post by Brucedg » 22 Jan 2020 15:24

Interesting :D

Jennes
Posts: 21
Joined: 19 May 2017 12:22

Re: Twilight

Post by Jennes » 14 Aug 2020 07:24

Perfect! Thanks!

Post Reply