Comments (4)
The example is correct but slightly confusing as the times being returned by the astral.sun.sun
function by default return times in the UTC timezone and the Location class is not used in the example. I'll add an example which uses the Location class that by default uses the local timezone.
If you do the following before printing it out you'll get times closer to what you were expecting
tz = pytz.timezone(pbmo.timezone)
s = sun(pbmo.observer, date=datetime.date(2020, 2, 11), tzinfo=tz)
from astral.
For my location today:
Sunrise 6:54
Meridian 12:15
Sunset 17:37
JT
from astral.
Thanks so much for clearing that up, I look forward to the example.
BTW, you have https://astral.readthedocs.io/en/latest/
Installation
To install Astral you should use the pip tool:
pip install astral
I'm sure you mean pip3 for Python 3
pip3 install astral
Thanks
JT
from astral.
Thanks for fixing the documents
JT
from astral.
Related Issues (20)
- Astral fails to correctly calculate sunrise and sunset times in unique test case of Norwegian Winter HOT 9
- Example in astral/docs/_sources/index.rst.txt needs to corrected.
- Feature request: Calculate Moon rise and set times HOT 4
- Astral v2 outputs dates in microseconds
- Dead links in docs
- Buggy times for northern hemisphere HOT 2
- Sunrise/sunset sometimes throws "sun always above horizon" during polar (24h) night
- Problems with error handling HOT 1
- v3.1 Changelog? HOT 1
- Mypy flags comment as invalid HOT 1
- Moon culminant/noon
- Sunrise time calculation error
- Sun rise and set cal error
- Sunset times returning for previous day HOT 4
- Missing sunsets for arctic circle locations HOT 2
- Add an Optional Argument to sun() Function to Return Only Specified Keys
- On only some days: ValueError: Unable to find a dusk time on the date specified HOT 8
- Help understanding the `timezone` field of a `LocationInfo`, does it do anything when used in tandem with sun?
- No moonrise when official almanac states there is (ditto sunrise) HOT 2
- Wrong calculation of obscuring feature calculation HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astral.