-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dates in Sunrise and Sunset results not always same as "date = " parameter #2
Comments
Hi, Which version are you using ? (
|
Hi,
Thanks so much for your response.
sessionInfo() is showing:
suncalc_0.4
I’m also using:
lubridate_1.7.4
Full dump is:
sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.3
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.7.4 suncalc_0.4
loaded via a namespace (and not attached):
[1] compiler_3.5.1 magrittr_1.5 tools_3.5.1 curl_3.2 yaml_2.2.0 Rcpp_0.12.18 V8_1.5 stringi_1.2.4 stringr_1.3.1 jsonlite_1.5
Regards,
Paul.
From: "B. Thieurmel" <[email protected]>
Reply-To: datastorm-open/suncalc <[email protected]>
Date: Thursday, 7 March 2019 at 8:50 pm
To: datastorm-open/suncalc <[email protected]>
Cc: Paul Robertson <[email protected]>, Author <[email protected]>
Subject: Re: [datastorm-open/suncalc] Dates in Sunrise and Sunset results not always same as "date = " parameter (#2)
Hi,
Which version are you using ? (sessionInfo()). I think this bug was fixed since 0.3 :
site_lat <- 34.052235
site_lon <- -118.243683
site_tz <- "US/Pacific"
getSunlightTimes(date = ymd("2018-11-01"), lat = site_lat, lon = site_lon, tz = site_tz, keep = c("sunrise", "sunset"))
date lat lon sunrise sunset
1 2018-11-01 12:00:00 34.05224 -118.2437 2018-11-01 07:13:51 2018-11-01 18:01:43
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Ab8FK4tQPkhFIpIVZNUb70v3wdDtDAy8ks5vUODpgaJpZM4Y0yI8>.
|
I am having the same problem, but for locations ahead of UTC, it's giving me the solar times for the next day.
I am using version 0.4. |
Process datetimes in UTC rather than system time zone to ensure returned date times are not offset by 1 day in `getSunlightTimes()`. Addresses the issue reported at datastorm-open#2
I believe this is happening because date times are being converted to the users local time zone prior to calling
But if I manually change my computer's timezone to "Asia/Seoul", I end up with the 5 westernmost locations being a day behind the input date.
If I modify this line https://github.com/mstrimas/suncalc/blob/master/R/getSunlightTimes.R#L85 to replace |
This is still a problem. Any plans to merge the pull request? |
New version available on github, and coming soon on CRAN. |
Looks great, thanks for the fix! |
Hi, thanks for a great package. However, I'm wondering if I've found a bug with (at least) Sunrise and Sunset times?
It appears that when a timezone being checked is behind UTC, the "date" component of Sunrise and Sunset is the "day before" the date being checked.
Examples are below:
The text was updated successfully, but these errors were encountered: