Sunrise / sunset time

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Sunrise / sunset time

Marc Pinnell-3
Thought I would throw this out there before I spent the time reinventing. Looking for a tag (or basic code) to query "something" for the local time of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't see anything. This would be for a L9 project, but obviously any code would be adaptable.

I did find an api/service to query (http://sunrise-sunset.org/api), but thought I would ask the group if anyone has already done this. Thanks in advance.

marc


Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Jolle Carlestam-2
Looks like a piece of cake to write a type that grabs data from that api. The tricky part as I see it would be to find out the correct latitude and longitude.


HDB
Jolle

Sent from a mobile device. Any anomalies is due to Autocorrect.

> 14 maj 2015 kl. 22:22 skrev Marc Pinnell <[hidden email]>:
>
> I did find an api/service to query (http://sunrise-sunset.org/api), but thought I would ask the group if anyone has already done this. Thanks in advance.

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Ke Carlton-3
Yes, javascript will need to be involved there to establish the location:

if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
console.log(position.coords.latitude,position.coords.longitude)
}, function() {
console.log('access to location not permitted')
})
} else {
console.log('geolocation not supported')
}

Ke


On Fri, May 15, 2015 at 8:56 AM Jolle Carlestam <[hidden email]> wrote:

> Looks like a piece of cake to write a type that grabs data from that api.
> The tricky part as I see it would be to find out the correct latitude and
> longitude.
>
>
> HDB
> Jolle
>
> Sent from a mobile device. Any anomalies is due to Autocorrect.
>
> > 14 maj 2015 kl. 22:22 skrev Marc Pinnell <[hidden email]>:
> >
> > I did find an api/service to query (http://sunrise-sunset.org/api), but
> thought I would ask the group if anyone has already done this. Thanks in
> advance.
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Steffan A. Cline
Or use a geo ip look up system to get lat / lon for the general area the
user is in.

It's not always flawless though if you're in a big corporation and your
head end is in another state.

I've had times where I looked myself up and it says I'm in Denver when
clearly I'm in Phoenix.

Thanks,
Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline   [hidden email]
http://www.ExecuChoice.net                 Phoenix, Arizona USA
                 
---------------------------------------------------------------






On 5/14/15, 2:28 PM, "Ke Carlton" <[hidden email]> wrote:

>Yes, javascript will need to be involved there to establish the location:
>
>if(navigator.geolocation) {
>navigator.geolocation.getCurrentPosition(function(position) {
>console.log(position.coords.latitude,position.coords.longitude)
>}, function() {
>console.log('access to location not permitted')
>})
>} else {
>console.log('geolocation not supported')
>}
>
>Ke
>
>
>On Fri, May 15, 2015 at 8:56 AM Jolle Carlestam <[hidden email]>
>wrote:
>
>> Looks like a piece of cake to write a type that grabs data from that
>>api.
>> The tricky part as I see it would be to find out the correct latitude
>>and
>> longitude.
>>
>>
>> HDB
>> Jolle
>>
>> Sent from a mobile device. Any anomalies is due to Autocorrect.
>>
>> > 14 maj 2015 kl. 22:22 skrev Marc Pinnell
>><[hidden email]>:
>> >
>> > I did find an api/service to query (http://sunrise-sunset.org/api),
>>but
>> thought I would ask the group if anyone has already done this. Thanks in
>> advance.
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: Sunrise / sunset time

Rick Draper-2
IP location lookups have become almost completely useless in many
situations, particularly with expansion in the use of proxies and external
filtering services.

We have a government client in Australia and their presenting IP is in
California, USA - must make watching US only content easier :-)

Very best regards.

Rick

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Steffan A. Cline
Sent: Friday, 15 May 2015 7:33 AM
To: [hidden email]
Subject: Re: Sunrise / sunset time

Or use a geo ip look up system to get lat / lon for the general area the
user is in.

It's not always flawless though if you're in a big corporation and your head
end is in another state.

I've had times where I looked myself up and it says I'm in Denver when
clearly I'm in Phoenix.

Thanks,
Steffan




#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Jolle Carlestam-2
In reply to this post by Ke Carlton-3
14 maj 2015 kl. 23:28 skrev Ke Carlton <[hidden email]>:

> Yes, javascript will need to be involved there to establish the location:

Ah, of course. Should have remembered that. It’s stuff we used at Amtac.

So  work flow would be:

Present a button/link on the page ”Show me Sunrise/Sunset”

When clicked browser requests geo location. Usually means the user have to accept the request.

If geo location is found, send an ajax call to the server with the location data

Have the server grab the data and pass it on to the sunrise/sunset api

Parse the response json and repackage it to send back to the browser

Have the browser present the data in the dom.


Piece of cake.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Jolle Carlestam-2
In reply to this post by Steffan A. Cline
14 maj 2015 kl. 23:32 skrev Steffan A. Cline <[hidden email]>:

> it says I'm in Denver when clearly I'm in Phoenix.

Are you really sure about that? NSA data shows you’re in Denver.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
In reply to this post by Jolle Carlestam-2
Actually in my case it's for a fixed location so that part is super simple. This would be used to determine whether to charge for lights on a sports field when reserving the field.

Sent from my small touch mobile device. Please excuse all typos.

> On May 14, 2015, at 1:56 PM, Jolle Carlestam <[hidden email]> wrote:
>
> Looks like a piece of cake to write a type that grabs data from that api. The tricky part as I see it would be to find out the correct latitude and longitude.
>
>
> HDB
> Jolle
>
> Sent from a mobile device. Any anomalies is due to Autocorrect.
>
>> 14 maj 2015 kl. 22:22 skrev Marc Pinnell <[hidden email]>:
>>
>> I did find an api/service to query (http://sunrise-sunset.org/api), but thought I would ask the group if anyone has already done this. Thanks in advance.
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
In reply to this post by Jolle Carlestam-2
Trying to remember... Wasn't there an issue with Json in L9? Tags were missing or something?

Sent from my small touch mobile device. Please excuse all typos.

> On May 14, 2015, at 1:56 PM, Jolle Carlestam <[hidden email]> wrote:
>
> Looks like a piece of cake to write a type that grabs data from that api. The tricky part as I see it would be to find out the correct latitude and longitude.
>
>
> HDB
> Jolle
>
> Sent from a mobile device. Any anomalies is due to Autocorrect.
>
>> 14 maj 2015 kl. 22:22 skrev Marc Pinnell <[hidden email]>:
>>
>> I did find an api/service to query (http://sunrise-sunset.org/api), but thought I would ask the group if anyone has already done this. Thanks in advance.
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Ke Carlton-3
Confusing that 8.5 I think; Lasso 9 has always had the JSON tags.

On Fri, May 15, 2015 at 9:44 AM Marc Pinnell <[hidden email]>
wrote:

> Trying to remember... Wasn't there an issue with Json in L9? Tags were
> missing or something?
>
> Sent from my small touch mobile device. Please excuse all typos.
>
> > On May 14, 2015, at 1:56 PM, Jolle Carlestam <[hidden email]>
> wrote:
> >
> > Looks like a piece of cake to write a type that grabs data from that
> api. The tricky part as I see it would be to find out the correct latitude
> and longitude.
> >
> >
> > HDB
> > Jolle
> >
> > Sent from a mobile device. Any anomalies is due to Autocorrect.
> >
> >> 14 maj 2015 kl. 22:22 skrev Marc Pinnell <[hidden email]
> >:
> >>
> >> I did find an api/service to query (http://sunrise-sunset.org/api),
> but thought I would ask the group if anyone has already done this. Thanks
> in advance.
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Jolle Carlestam-2
In reply to this post by Marc Pinnell-3
14 maj 2015 kl. 23:44 skrev Marc Pinnell <[hidden email]>:

> Trying to remember... Wasn't there an issue with Json in L9? Tags were missing or something?

Lasso 9 has had json support from the beginning. I’ve used it extensively since the first version of Lasso 9.
A new version of json encoding decoding was announced as part of Lasso 9.3 put never actually distributed in the install. Maybe that’s what you’re thinking about.
They can however be fetched from Lassos SVN repo. In this particular case I doubt it’s needed. The benefit with the new json types is speed, but you would deal with so small chunks of data it’s not worth the effort.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

stevepiercy
In reply to this post by Ke Carlton-3
There was a performance issue with large JSON objects.  I can't
recall whether it had been improved.  I recall that one
developer provided improvements to the methods.

--steve


On 5/14/15 at 9:48 PM, [hidden email] (Ke Carlton) pronounced:

>Confusing that 8.5 I think; Lasso 9 has always had the JSON tags.
>
>On Fri, May 15, 2015 at 9:44 AM Marc Pinnell <[hidden email]>
>wrote:
>
>>Trying to remember... Wasn't there an issue with Json in L9? Tags were
>>missing or something?
>>
>>Sent from my small touch mobile device. Please excuse all typos.
>>
>>>On May 14, 2015, at 1:56 PM, Jolle Carlestam <[hidden email]>
>>wrote:
>>>
>>>Looks like a piece of cake to write a type that grabs data from that
>>api. The tricky part as I see it would be to find out the correct latitude
>>and longitude.
>>>
>>>
>>>HDB
>>>Jolle
>>>
>>>Sent from a mobile device. Any anomalies is due to Autocorrect.
>>>
>>>> 14 maj 2015 kl. 22:22 skrev Marc Pinnell <[hidden email]
>>>:
>>>>
>>>> I did find an api/service to query (http://sunrise-sunset.org/api),
>>but thought I would ask the group if anyone has already done this. Thanks
>>in advance.
>>>
>>>#############################################################
>>>
>>>This message is sent to you because you are subscribed to
>>>the mailing list Lasso [hidden email]
>>>Official list archives available at http://www.lassotalk.com
>>>To unsubscribe, E-mail to: <[hidden email]>
>>>Send administrative queries to  <[hidden email]>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
In reply to this post by Jolle Carlestam-2
That was probably it. Thanks everyone.

marc


On May 14, 2015, at 2:50 PM, Jolle Carlestam <[hidden email]> wrote:

> 14 maj 2015 kl. 23:44 skrev Marc Pinnell <[hidden email]>:
>
>> Trying to remember... Wasn't there an issue with Json in L9? Tags were missing or something?
>
> Lasso 9 has had json support from the beginning. I’ve used it extensively since the first version of Lasso 9.
> A new version of json encoding decoding was announced as part of Lasso 9.3 put never actually distributed in the install. Maybe that’s what you’re thinking about.
> They can however be fetched from Lassos SVN repo. In this particular case I doubt it’s needed. The benefit with the new json types is speed, but you would deal with so small chunks of data it’s not worth the effort.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Ke Carlton-3
In reply to this post by stevepiercy
I think you may be thinking of Lasso 8.x — James posted a faster JSON
decode for it here:

http://www.lassosoft.com/rhinotrac?id=7750

I think Lasso 9 has always been faster that L8.x in terms of JSON decoding:

Lasso 8.6: decode_json — 76,420 micro seconds (76 milliseconds)
Lasso 9.2: json_deserialize — 152 micros seconds
Lasso 9.3: json_decode — 29 micro seconds

Seems like a good motivator to move from Lasso 8.x (all of the above were
run on the same hardware / vm config)

Ke

 local('json') = '{"categories":["Butters",
"Knives"],"cfprojectdisplay":["Parking
Required"],"customfilter":["Posters", "Polistillstånd"],"descr":"Spännande
konsert med massor av
magi","display_pstatus":"Konfidentiell","display_type":"Konsert-/Musikproduktion
vuxen","id":"9766-47d6-b8f7-6adb87aef85c","images":[],"incharge_id":"dcd21c1f-ac7c-4be1-bbbb-4c7aef0a321e","incharge_name":"Lotta
Brusk","lengthofshow_hour":"1","lengthofshow_info":"","lengthofshow_minute":"30","lock":"aHV42uQS1aSjRiWvUyzXIe9Of36AW7B/fAzFMwVS694az0g6IeakrWD+U04G3VvB2Cs01ZPd","name":"Calypso","notes":"Noteringar
ang. rider\n\nBackline, borde inte vara något problem men kommer
naturligtvis att kosta kanske 2000 inkl transporter etc men eftersom det är
på kulturnatten så blir det väl en klumpsumma för transporter.\nPA på
plats, möjlitvis blir det annan typ av mixer men i så fall inte sämre, det
viktiga är nog att informera akten i god tid innan vilken mixer det blir,
om det är mycket svårt för dem att köra på den mixer som kommer från
hyrföretaget så har vi en M7CL som vi kan ställa dit.","owningorg":"Calypso
Prod","participatingfemaleartist":"3","participatingfemaleother":"1","participatingindeterartist":"","participatingindeterother":"","participatingmaleartist":"3","participatingmaleother":"2","participatingunknownartist":"","participatingunknownother":"","project":"4a58-ae49-a0b61c09882c","projectname":"Kulturnatten
2015","pstatus":"confidential","ptype":"music_adults","startdate":"2015-02-13","stopdate":"","success":true,"targets":["Vuxna"]}';





On Fri, May 15, 2015 at 9:51 AM Steve Piercy - Website Builder <
[hidden email]> wrote:

> There was a performance issue with large JSON objects.  I can't
> recall whether it had been improved.  I recall that one
> developer provided improvements to the methods.
>
> --steve
>
>
> On 5/14/15 at 9:48 PM, [hidden email] (Ke Carlton) pronounced:
>
> >Confusing that 8.5 I think; Lasso 9 has always had the JSON tags.
> >
> >On Fri, May 15, 2015 at 9:44 AM Marc Pinnell <
> [hidden email]>
> >wrote:
> >
> >>Trying to remember... Wasn't there an issue with Json in L9? Tags were
> >>missing or something?
> >>
> >>Sent from my small touch mobile device. Please excuse all typos.
> >>
> >>>On May 14, 2015, at 1:56 PM, Jolle Carlestam <[hidden email]>
> >>wrote:
> >>>
> >>>Looks like a piece of cake to write a type that grabs data from that
> >>api. The tricky part as I see it would be to find out the correct
> latitude
> >>and longitude.
> >>>
> >>>
> >>>HDB
> >>>Jolle
> >>>
> >>>Sent from a mobile device. Any anomalies is due to Autocorrect.
> >>>
> >>>> 14 maj 2015 kl. 22:22 skrev Marc Pinnell <
> [hidden email]
> >>>:
> >>>>
> >>>> I did find an api/service to query (http://sunrise-sunset.org/api),
> >>but thought I would ask the group if anyone has already done this. Thanks
> >>in advance.
> >>>
> >>>#############################################################
> >>>
> >>>This message is sent to you because you are subscribed to
> >>>the mailing list Lasso [hidden email]
> >>>Official list archives available at http://www.lassotalk.com
> >>>To unsubscribe, E-mail to: <[hidden email]>
> >>>Send administrative queries to  <[hidden email]>
> >>
> >>#############################################################
> >>
> >>This message is sent to you because you are subscribed to
> >>the mailing list Lasso [hidden email]
> >>Official list archives available at http://www.lassotalk.com
> >>To unsubscribe, E-mail to: <[hidden email]>
> >>Send administrative queries to  <[hidden email]>
> >>
> >
> >#############################################################
> >
> >This message is sent to you because you are subscribed to
> >the mailing list Lasso [hidden email]
> >Official list archives available at http://www.lassotalk.com
> >To unsubscribe, E-mail to: <[hidden email]>
> >Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Bil Corry-3
In reply to this post by Marc Pinnell-3
I used a library to make an LCAPI module to calculate positions of the
planets.  The library can also calculate sunrise and sunset.

http://www.astro.com/swisseph/swephinfo_e.htm

I can dig up the LCAPI code, but I think it was for LP8.5, if interested.

- Bil

On Thu, May 14, 2015 at 10:22 PM, Marc Pinnell <[hidden email]
> wrote:

> Thought I would throw this out there before I spent the time reinventing.
> Looking for a tag (or basic code) to query "something" for the local time
> of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't
> see anything. This would be for a L9 project, but obviously any code would
> be adaptable.
>
> I did find an api/service to query (http://sunrise-sunset.org/api), but
> thought I would ask the group if anyone has already done this. Thanks in
> advance.
>
> marc
>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
Thanks for the offer. Jolle was right in that the api I referenced turned out to be super simple to pull the time out of. Just tackling the UTC -> Pacific time conversions right now.

The API is returning "3:18:22 AM". According to weather.com sunset today is "8:18 PM". Now how to convert... back to the docs!

marc


On May 14, 2015, at 5:49 PM, Bil Corry <[hidden email]> wrote:

> I used a library to make an LCAPI module to calculate positions of the
> planets.  The library can also calculate sunrise and sunset.
>
> http://www.astro.com/swisseph/swephinfo_e.htm
>
> I can dig up the LCAPI code, but I think it was for LP8.5, if interested.
>
> - Bil
>
> On Thu, May 14, 2015 at 10:22 PM, Marc Pinnell <[hidden email]
>> wrote:
>
>> Thought I would throw this out there before I spent the time reinventing.
>> Looking for a tag (or basic code) to query "something" for the local time
>> of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't
>> see anything. This would be for a L9 project, but obviously any code would
>> be adaptable.
>>
>> I did find an api/service to query (http://sunrise-sunset.org/api), but
>> thought I would ask the group if anyone has already done this. Thanks in
>> advance.
>>
>> marc
>>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

stevepiercy
Hint: use locale.
http://www.lassosoft.com/lassoDocs/languageReference/obj/date

--steve


On 5/14/15 at 6:16 PM, [hidden email] (Marc Pinnell) pronounced:

> Thanks for the offer. Jolle was right in that the api I referenced turned out to be
> super simple to pull the time out of. Just tackling the UTC -> Pacific time conversions
> right now.
>
> The API is returning "3:18:22 AM". According to weather.com sunset today is "8:18 PM".
> Now how to convert... back to the docs!
>
> marc
>
>
> On May 14, 2015, at 5:49 PM, Bil Corry <[hidden email]> wrote:
>
> > I used a library to make an LCAPI module to calculate positions of the
> > planets.  The library can also calculate sunrise and sunset.
> >
> > http://www.astro.com/swisseph/swephinfo_e.htm
> >
> > I can dig up the LCAPI code, but I think it was for LP8.5, if interested.
> >
> > - Bil
> >
> > On Thu, May 14, 2015 at 10:22 PM, Marc Pinnell <[hidden email]
> >> wrote:
> >
> >> Thought I would throw this out there before I spent the time reinventing.
> >> Looking for a tag (or basic code) to query "something" for the local time
> >> of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't
> >> see anything. This would be for a L9 project, but obviously any code would
> >> be adaptable.
> >>
> >> I did find an api/service to query (http://sunrise-sunset.org/api), but
> >> thought I would ask the group if anyone has already done this. Thanks in
> >> advance.
> >>
> >> marc
> >>
> >>
> >> Marc Pinnell
> >> 1027 Design
> >> PO Box 990872
> >> Redding, CA 96099-0872
> >> 530.941.4706
> >> fax: 866.232.5300
> >> www.1027Design.com
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >>  the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >>
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
Was just looking at that page actually, but I don't see where it actually converts the time. That's just about output... right?

marc


On May 14, 2015, at 6:35 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> Hint: use locale.
> http://www.lassosoft.com/lassoDocs/languageReference/obj/date
>
> --steve
>
>
> On 5/14/15 at 6:16 PM, [hidden email] (Marc Pinnell) pronounced:
>
>> Thanks for the offer. Jolle was right in that the api I referenced turned out to be
>> super simple to pull the time out of. Just tackling the UTC -> Pacific time conversions
>> right now.
>>
>> The API is returning "3:18:22 AM". According to weather.com sunset today is "8:18 PM".
>> Now how to convert... back to the docs!
>>
>> marc
>>
>>
>> On May 14, 2015, at 5:49 PM, Bil Corry <[hidden email]> wrote:
>>
>>> I used a library to make an LCAPI module to calculate positions of the
>>> planets.  The library can also calculate sunrise and sunset.
>>>
>>> http://www.astro.com/swisseph/swephinfo_e.htm
>>>
>>> I can dig up the LCAPI code, but I think it was for LP8.5, if interested.
>>>
>>> - Bil
>>>
>>> On Thu, May 14, 2015 at 10:22 PM, Marc Pinnell <[hidden email]
>>>> wrote:
>>>
>>>> Thought I would throw this out there before I spent the time reinventing.
>>>> Looking for a tag (or basic code) to query "something" for the local time
>>>> of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't
>>>> see anything. This would be for a L9 project, but obviously any code would
>>>> be adaptable.
>>>>
>>>> I did find an api/service to query (http://sunrise-sunset.org/api), but
>>>> thought I would ask the group if anyone has already done this. Thanks in
>>>> advance.
>>>>
>>>> marc
>>>>
>>>>
>>>> Marc Pinnell
>>>> 1027 Design
>>>> PO Box 990872
>>>> Redding, CA 96099-0872
>>>> 530.941.4706
>>>> fax: 866.232.5300
>>>> www.1027Design.com
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
Got it.

date_gmttolocal(#gmtsunset)

Not documented in L9, but it's there apparently. Found an old post by Bil.

Marc


On May 14, 2015, at 6:40 PM, Marc Pinnell <[hidden email]> wrote:

> Was just looking at that page actually, but I don't see where it actually converts the time. That's just about output... right?
>
> marc
>
>
> On May 14, 2015, at 6:35 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
>> Hint: use locale.
>> http://www.lassosoft.com/lassoDocs/languageReference/obj/date
>>
>> --steve
>>
>>
>> On 5/14/15 at 6:16 PM, [hidden email] (Marc Pinnell) pronounced:
>>
>>> Thanks for the offer. Jolle was right in that the api I referenced turned out to be
>>> super simple to pull the time out of. Just tackling the UTC -> Pacific time conversions
>>> right now.
>>>
>>> The API is returning "3:18:22 AM". According to weather.com sunset today is "8:18 PM".
>>> Now how to convert... back to the docs!
>>>
>>> marc
>>>
>>>
>>> On May 14, 2015, at 5:49 PM, Bil Corry <[hidden email]> wrote:
>>>
>>>> I used a library to make an LCAPI module to calculate positions of the
>>>> planets.  The library can also calculate sunrise and sunset.
>>>>
>>>> http://www.astro.com/swisseph/swephinfo_e.htm
>>>>
>>>> I can dig up the LCAPI code, but I think it was for LP8.5, if interested.
>>>>
>>>> - Bil
>>>>
>>>> On Thu, May 14, 2015 at 10:22 PM, Marc Pinnell <[hidden email]
>>>>> wrote:
>>>>
>>>>> Thought I would throw this out there before I spent the time reinventing.
>>>>> Looking for a tag (or basic code) to query "something" for the local time
>>>>> of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't
>>>>> see anything. This would be for a L9 project, but obviously any code would
>>>>> be adaptable.
>>>>>
>>>>> I did find an api/service to query (http://sunrise-sunset.org/api), but
>>>>> thought I would ask the group if anyone has already done this. Thanks in
>>>>> advance.
>>>>>
>>>>> marc
>>>>>
>>>>>
>>>>> Marc Pinnell
>>>>> 1027 Design
>>>>> PO Box 990872
>>>>> Redding, CA 96099-0872
>>>>> 530.941.4706
>>>>> fax: 866.232.5300
>>>>> www.1027Design.com
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> Marc Pinnell
>>> 1027 Design
>>> PO Box 990872
>>> Redding, CA 96099-0872
>>> 530.941.4706
>>> fax: 866.232.5300
>>> www.1027Design.com
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy              Website Builder              Soquel, CA
>> <[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sunrise / sunset time

Marc Pinnell-3
Spoke too soon... :(

The Code:
//What time is sunset?
local(
        sunsetinfo = json_deserialize(include_url(
                        'http://api.sunrise-sunset.org/json?lat=40.572838&lng=-122.30407&date=' + $selDate->format('yyyy-MM-dd')
                        ))->find('results'),
        gmtsunset = date($selDate->format('yyyy-MM-dd') + 'T' + #sunsetinfo->find('sunset')->asString + 'Z'),
        localsunset = date_gmttolocal(date(#gmtsunset, -format='%QT%TZ', -gmt)),
        localsunsettime = date($selDate->format('yyyy-MM-dd ') + ' ' + #localsunset->format('HH:mm:ss'))
        )

content_body += 'GMT: ' + #gmtsunset + '<br />'
content_body += 'Local: ' + #localsunset + '<br />'
content_body += 'Local2: ' + #localsunsettime


Where $selDate = 2015-11-06 returns:
GMT: 2015-11-06T01:00:00Z
Local: 2015-11-05 17:00:00
Local2: 2015-11-06 17:00:00

Where $selDate = 2015-11-07 returns:
GMT: 2015-11-07T12:58:56Z
Local: 2015-11-07 04:58:56
Local2: 2015-11-07 04:58:56


Not sure what the significance of November 6th/7th is. My Calendar as Daylight Savings is November 1. All tests of dates from to November 7 to January 8 give the wrong time conversion. From what I can tell all dates outside that window return correct times.

Must be time for a dinner break.

What am I missing?

marc




On May 14, 2015, at 6:53 PM, Marc Pinnell <[hidden email]> wrote:

> Got it.
>
> date_gmttolocal(#gmtsunset)
>
> Not documented in L9, but it's there apparently. Found an old post by Bil.
>
> Marc
>
>
> On May 14, 2015, at 6:40 PM, Marc Pinnell <[hidden email]> wrote:
>
>> Was just looking at that page actually, but I don't see where it actually converts the time. That's just about output... right?
>>
>> marc
>>
>>
>> On May 14, 2015, at 6:35 PM, Steve Piercy - Website Builder <[hidden email]> wrote:
>>
>>> Hint: use locale.
>>> http://www.lassosoft.com/lassoDocs/languageReference/obj/date
>>>
>>> --steve
>>>
>>>
>>> On 5/14/15 at 6:16 PM, [hidden email] (Marc Pinnell) pronounced:
>>>
>>>> Thanks for the offer. Jolle was right in that the api I referenced turned out to be
>>>> super simple to pull the time out of. Just tackling the UTC -> Pacific time conversions
>>>> right now.
>>>>
>>>> The API is returning "3:18:22 AM". According to weather.com sunset today is "8:18 PM".
>>>> Now how to convert... back to the docs!
>>>>
>>>> marc
>>>>
>>>>
>>>> On May 14, 2015, at 5:49 PM, Bil Corry <[hidden email]> wrote:
>>>>
>>>>> I used a library to make an LCAPI module to calculate positions of the
>>>>> planets.  The library can also calculate sunrise and sunset.
>>>>>
>>>>> http://www.astro.com/swisseph/swephinfo_e.htm
>>>>>
>>>>> I can dig up the LCAPI code, but I think it was for LP8.5, if interested.
>>>>>
>>>>> - Bil
>>>>>
>>>>> On Thu, May 14, 2015 at 10:22 PM, Marc Pinnell <[hidden email]
>>>>>> wrote:
>>>>>
>>>>>> Thought I would throw this out there before I spent the time reinventing.
>>>>>> Looking for a tag (or basic code) to query "something" for the local time
>>>>>> of sunrise / sunset. Took a quick look at TagSwap and LassoGuide and didn't
>>>>>> see anything. This would be for a L9 project, but obviously any code would
>>>>>> be adaptable.
>>>>>>
>>>>>> I did find an api/service to query (http://sunrise-sunset.org/api), but
>>>>>> thought I would ask the group if anyone has already done this. Thanks in
>>>>>> advance.
>>>>>>
>>>>>> marc
>>>>>>
>>>>>>
>>>>>> Marc Pinnell
>>>>>> 1027 Design
>>>>>> PO Box 990872
>>>>>> Redding, CA 96099-0872
>>>>>> 530.941.4706
>>>>>> fax: 866.232.5300
>>>>>> www.1027Design.com
>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>>
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> Marc Pinnell
>>>> 1027 Design
>>>> PO Box 990872
>>>> Redding, CA 96099-0872
>>>> 530.941.4706
>>>> fax: 866.232.5300
>>>> www.1027Design.com
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Soquel, CA
>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
12