#33671 [Com]: sun_rise and sun_set don't return a GMT timestamp if one passes an offset

2005-07-26 Thread bhazboun03 at yahoo dot com
 ID:   33671
 Comment by:   bhazboun03 at yahoo dot com
 Reported By:  golf at dds dot nl
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: Linux Debian
 PHP Version:  5.0.4
 Assigned To:  derick
 New Comment:

we offer web hosting with a personal web page design - plus free web
hosting and a cheap web hosting plans we are one of the best web
hosting provider company

www.throughhosting.com
www.throughhosting.com/links

ThroughSearch.com is your complete source for a fast search engine
results and Search Engine Marketing tips. Our Search Engine Results are
powered by Google Search Engine.

www.throughsearch.com Search Engine
www.throughsearch.com/directory  Web directory
paper Supplier - paper porducts international paper a
http://www.venuspaper.com international paper
arab search engine http://www.throughsearch.com/arab-search.php  arab
search engine


Previous Comments:


[2005-07-15 15:11:36] golf at dds dot nl

I don't think this is the same bug as #32820. There seems to be a
difference in that one doesn't get A GMT timestamp but one with an
offset of +1 if one passes an offset to date_sunrise and date_sunset.
This means that one seems to get a timestamp, but this isn't a
timestamp. And with the other bugreport there seems to be a logic
error, not a timestamp error.

As before, when I use both functions I aspect to get a timestamp back
for witch the timezone is GMT* and not in the timezone for witch I
added the offset to the functions...

*As is normal with a timestamp



[2005-07-13 07:45:56] [EMAIL PROTECTED]

Duplicate of: #32820



[2005-07-13 02:35:59] golf at dds dot nl

I have also swaped lat and long and this solves my basic problem that
the hours where wrong, but one can say that the bug is still there
since my first suspision is correct, GMT offset is not used to
calculate anything, it changes the timestamp to something that looks
and feels like a timestamp but isn't since it isn't a GMT date/time
combo but the GMT date/time combo + the offset. Since this isn't
standard for timestamp I changed the status of this Bug to open...

The algorithm looks to work acourding to this:
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
Where one can read the last line to see it is just added...

My objection to the way the functions work probably won't make a change
list, but it is something to add as a note to the manual becouse it is
confusing (At least to me and perhaps more people).



[2005-07-13 01:08:22] golf at dds dot nl

After re-reading the source in the bug-report I now see that I passed
$long and $lat where I should have passed $longitude, $latitude. I
changed the code and now every thing seems oke... 

Sorry for the hassle made by this report but I realy missed this typo.

Regards,

Golf

P.S. I tryd to add a comment to this bugreport (twice) but it didn't
show up, so if there are more than one...



[2005-07-13 00:53:07] golf at dds dot nl

Description:

With my current version of PHP5 (5.0.4-0.6.sarge.1 (Debian GNU/Linux) I
run into an error if I use date_sunrise and date_sunset. This happens
when I pass an GMT offset and results in a timestamp that has an offset
of +1 hour to the actual sun set/rise on that date. Since timestamps are
GMT/UTC and not bound to an timezone other that GMT/UTC this is wrong. I
say this since I believe the GMT offset one can pass to the before
mentioned functions is used in the calculation and the functions should
return a timestamp like any other so it can be used by date and gmdate
as those functions require a GMT/UTC timestamp...

B.t.w. I use the max difference for some further calculations in my
script, so there for the lage difference between astro and official
sunset's/rises...

Reproduce code:
---
$latitude = 28 + (1/60*17) + (1/60/60*54);
$longitude = (-(16 + (1/60*30) + (1/60/60*34)));
$astro = 108;
$official = (90 + (1/60*50));

echo Local Tenerife timebr\n;
echo sunriseAstro =  . gmdate(M d Y H:i:s, date_sunrise(1121208238,
SUNFUNCS_RET_TIMESTAMP, $long, $lat, $astro, 1) + 60*60) . br\n;
echo sunriseOffical =  . gmdate(M d Y H:i:s,
date_sunrise(1121208238, SUNFUNCS_RET_TIMESTAMP, $long, $lat, $official
, 1) + 60*60) . br\n;
echo sunsetOffical =  . gmdate(M d Y H:i:s, date_sunset(1121208238,
SUNFUNCS_RET_TIMESTAMP, $long, $lat, $official, 1) + 60*60) . br\n;
echo sunsetAstro =  . gmdate(M d Y H:i:s, date_sunset(1121208238,
SUNFUNCS_RET_TIMESTAMP, $long, $lat, $astro, 1) + 60*60) . p\n;


Expected result:

Local Tenerife time
sunriseAstro = Jul 12 2005 05:47:50
sunriseOffical = Jul 12 2005

#33671 [Com]: sun_rise and sun_set don't return a GMT timestamp if one passes an offset

2005-07-26 Thread bhazboun03 at yahoo dot com
 ID:   33671
 Comment by:   bhazboun03 at yahoo dot com
 Reported By:  golf at dds dot nl
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: Linux Debian
 PHP Version:  5.0.4
 Assigned To:  derick
 New Comment:

we offer web hosting with a personal web page design - plus free web
hosting and a cheap web hosting plans we are one of the best web
hosting provider company

http://www.throughhosting.com  Web Hosting
http://www.throughhosting.com/links  directory

ThroughSearch.com is your complete source for a fast search engine
results and Search Engine Marketing tips. Our Search Engine Results are
powered by Google Search Engine.

http://www.throughsearch.com  Search Engine
http://www.throughsearch.com/directory directory


Previous Comments:


[2005-07-27 07:38:52] bhazboun03 at yahoo dot com

we offer web hosting with a personal web page design - plus free web
hosting and a cheap web hosting plans we are one of the best web
hosting provider company

www.throughhosting.com
www.throughhosting.com/links

ThroughSearch.com is your complete source for a fast search engine
results and Search Engine Marketing tips. Our Search Engine Results are
powered by Google Search Engine.

www.throughsearch.com Search Engine
www.throughsearch.com/directory  Web directory
paper Supplier - paper porducts international paper a
http://www.venuspaper.com international paper
arab search engine http://www.throughsearch.com/arab-search.php  arab
search engine



[2005-07-15 15:11:36] golf at dds dot nl

I don't think this is the same bug as #32820. There seems to be a
difference in that one doesn't get A GMT timestamp but one with an
offset of +1 if one passes an offset to date_sunrise and date_sunset.
This means that one seems to get a timestamp, but this isn't a
timestamp. And with the other bugreport there seems to be a logic
error, not a timestamp error.

As before, when I use both functions I aspect to get a timestamp back
for witch the timezone is GMT* and not in the timezone for witch I
added the offset to the functions...

*As is normal with a timestamp



[2005-07-13 07:45:56] [EMAIL PROTECTED]

Duplicate of: #32820



[2005-07-13 02:35:59] golf at dds dot nl

I have also swaped lat and long and this solves my basic problem that
the hours where wrong, but one can say that the bug is still there
since my first suspision is correct, GMT offset is not used to
calculate anything, it changes the timestamp to something that looks
and feels like a timestamp but isn't since it isn't a GMT date/time
combo but the GMT date/time combo + the offset. Since this isn't
standard for timestamp I changed the status of this Bug to open...

The algorithm looks to work acourding to this:
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
Where one can read the last line to see it is just added...

My objection to the way the functions work probably won't make a change
list, but it is something to add as a note to the manual becouse it is
confusing (At least to me and perhaps more people).



[2005-07-13 01:08:22] golf at dds dot nl

After re-reading the source in the bug-report I now see that I passed
$long and $lat where I should have passed $longitude, $latitude. I
changed the code and now every thing seems oke... 

Sorry for the hassle made by this report but I realy missed this typo.

Regards,

Golf

P.S. I tryd to add a comment to this bugreport (twice) but it didn't
show up, so if there are more than one...



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33671

-- 
Edit this bug report at http://bugs.php.net/?id=33671edit=1