• Welcome to TodayPlus Boards v2.
 

Hours of Daylight

Started by dgmele, April 25, 2005, 01:13:42 PM

Previous topic - Next topic

dgmele

Is there a way of having TodayPlus show hours of daylight? Perhaps a formula involving sunrise and sunset times?

uk_skinner

Quote from: dgmeleIs there a way of having TodayPlus show hours of daylight? Perhaps a formula involving sunrise and sunset times?

dgmele:

 One possible way is to use an exe to obtain the sunrise and sunset time from weather.com and do the calculation, then write it into regsitry key.  Then use the skin code to call it out.  The exe can be triggered using TpExeDelay.

I think there is a way to calculate the sunrise and sunset based on the latitude/longtitude and timezone.  If some can provide me the information, a small exe can be developed.  But again, it needs to be in registry key in order to be used by TP.

Broesel

Quote from: dgmeleIs there a way of having TodayPlus show hours of daylight? Perhaps a formula involving sunrise and sunset times?

There is a command :

suntime,0,daylength,official,x,y,HH:mm,,,l

It is the difference between sunrise and sunset in hours ...

Take a look in the reference to look the parameters.

Regards Broesel

uk_skinner

broesel:

 For some reason, you will get "negative" number for certain location.  That was the problem I believed.

Geezer

Quote from: uk_skinnerbroesel:

 For some reason, you will get "negative" number for certain location.  That was the problem I believed.

This is correct.  I get a negative number for Fort Worth but it works for Columbus, OH or Vancouver, BC.
Toshiba e800, PPC2003 SE, 2.2 Gb MicroDrive, 512 CF, 512 SD, 2 Extended Batteries, Plus other excentric goodies.

Broesel

Quote from: uk_skinnerbroesel:

 For some reason, you will get "negative" number for certain location.  That was the problem I believed.

Yes, I know that, you get negative values for some cities not in your timezone,
because the time from other timezones is shown in local time ...

Regards Broesel

uk_skinner

Quote from: Broesel
Quote from: uk_skinnerbroesel:

 For some reason, you will get "negative" number for certain location.  That was the problem I believed.

Yes, I know that, you get negative values for some cities not in your timezone,
because the time from other timezones is shown in local time ...

Regards Broesel

In dgmele's case, the number is negative even it is the local time zone.

Broesel

Quote from: uk_skinner
In dgmele's case, the number is negative even it is the local time zone.

Well, mybe there is a bug in the command, but most time the lat / lon
values are not correct. Did you try with the values from dgmele ?

Regards Broesel

uk_skinner

Yes, I did try once.  I remember it was Vancover.

Broesel

Quote from: uk_skinnerYes, I did try once.  I remember it was Vancover.

Yes, you're right, just tested with vancouver and got negative values :cry:

So the command daylength is not usable for some locations ...

Regards Broesel

Geezer

Quote from: Broesel
Quote from: uk_skinnerYes, I did try once.  I remember it was Vancover.

Yes, you're right, just tested with vancouver and got negative values :cry:

So the command daylength is not usable for some locations ...

Regards Broesel

I'm in Fort Worth and use that for the local and it's also a negative number.  But it does work from me with a positive number for my other locations.  I've had a couple of folks, UK and ZapMe1 included, test out the Fort Worth lat and long and it does the same for them.  So, I think you are right...  it's broke.  :lol:   Where's SRS when we need him?   :cry:
Toshiba e800, PPC2003 SE, 2.2 Gb MicroDrive, 512 CF, 512 SD, 2 Extended Batteries, Plus other excentric goodies.

eemond

Got bored this W/E, tired of looking at negative numbers. Took UK's lead and ran with it.

http://weather.yahoo.com/forecast/USMA0056.html

has a Sunrise/Sunset.

Modified my Weather Feed:

http://todayplus.jhollin1138.com/rss/forecast_yahoo_txt.php?Citycode=USMA0056&Language=US

to add 3 new attributes (this.swSunrise, this.swSunset and this.swDayLength).

Wrote another small Suntime.EXE (after UK's TpRegistyWind) to extract from the city1.txt and create a TP Registry text entry:

City1Sunrise, City1Sunset and City1DayLength.

Skin code changes from/to

//suntime,%var9%,sunrise,official,38,31,HH:mm,Rise:     ,,l
text,38,31,Rise:,l
text104,31,%City%var9%Sunrise%,r

//suntime,%var9%,sunset,official,38,41,HH:mm,Set:      ,,l
text,38,41,Set:,l
text104,41,%City%var9%Sunset%,r

suntime,%var9%,daylength,official,38,51,HH:mm,Length: ,,l
text,38,51,Visibility:,l
text104,51,%City%var9%DayLength%,r

Maybe UK will have time to modify some of the other Weather Feeds.

Regards,
eemond

ZapMe1

Very nice work Ed, Thank You !!!!!

I too was getting tired of negative numbers, and I know Geezer was also !!  His "old eyes" couldn't take it anymore !!  :wink:
ZapMe1

"The most knowledgable person in the world is not the one who possesses the most knowledge, but the one who surrounds themselves with the greatest number of knowledgable people"

Broesel

Nice Idea ed,

will give it a try, when I get home  :D

Regards Broesel

Geezer

Yes, Thank you VERY much Ed!  I really am tired of seeing the negative numbers.
Toshiba e800, PPC2003 SE, 2.2 Gb MicroDrive, 512 CF, 512 SD, 2 Extended Batteries, Plus other excentric goodies.