Quantcast
Channel: Squeezebox : Community : Forums
Viewing all articles
Browse latest Browse all 6235

TimeZone DST handling

$
0
0
I knew that I would have to face this at some point ... and it is now.

The Perl DateTime module is not included by default in Slimserver distributions.
So I am trying to find a way to determine if a specified "zone" is currently (or more correctly would be with a given date time) is Daylight Saving and then what is the offset.

Reason:
The software is running in numerous places around the world (LMS installations) - so I cannot rely on using local time and local DST since rules are different.
The date/time stamp from the remote provider has no provided timezone information but (through configuration) it is known where in the world it is.

e.g.
Remote (radio station) says:
2021-03-28 11:08:50
which is
2021-03-28 10:08:50 GMT - unixtime - 1616926130 - because the station is in UK and UK just moved to DST.

I can cheat and put in my own local DST check to say ... this radio station is in UK and time between end of March and end of October so this is +1 time offset
but I would prefer to do it with proper Perl modules.

So - do I have to bundle DateTime module with my plugin and risk it being out of date or perhaps it relies on some stuff that is not Pure Perl so I end up with platform dependant binaries and the pain that causes?

Viewing all articles
Browse latest Browse all 6235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>