Page 1 of 1

Twilight

Posted: 18 Feb 2018 20:25
by Elkanah
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

Re: Twilight

Posted: 19 Jan 2020 01:35
by anuraag
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

Re: Twilight

Posted: 22 Jan 2020 15:24
by Brucedg
Interesting :D

Re: Twilight

Posted: 14 Aug 2020 07:24
by Jennes
Perfect! Thanks!