KenWillmott / SolarPosition

Arduino Library to calculate the position of the sun relative to geographic coordinates
71 stars 21 forks source link

how to convert UTC to local time #6

Closed shoaib955 closed 2 years ago

shoaib955 commented 3 years ago

I'm working on simple heliostat project, and I've found this library very useful. but very difficult to understand for me. I'm using RTC (DS3231) and Arduino Uno. with the example sketch "solarTmeRTC" which is working perfectly with my lat and long. the only issue is "I can't convert UTC to local time (+5.5)" could you please help me to get the local time

thank you...

KenWillmott commented 3 years ago

First of all, I hope you realize that solar calculations require the time reference to remain in UTC time (in this case your RTC). If you want to display local times for solar positions with boards that use the AVR processor (including the UNO), the easiest way to get local time is to use a time zone library, such as Jack Christensen's:

https://github.com/JChristensen/Timezone

Again, the RTC must remain set to UTC.

Thanks, Ken

On 2020-12-19 04:47, shoaib955 wrote:

I'm working on simple heliostat project, and I've found this library very useful. but very difficult to understand for me. I'm using RTC (DS3231) and Arduino Uno. with the example sketch "solarTmeRTC" which is working perfectly with my lat and long. the only issue is "I can't convert UTC to local time (+5.5)" could you please help me to get the local time

thank you...

-- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or unsubscribe [2].

Links:

[1] https://github.com/KenWillmott/SolarPosition/issues/6 [2] https://github.com/notifications/unsubscribe-auth/AEEKY4ZKPQB7CUKQYPNECZDSVRZCPANCNFSM4VCFO4UQ