🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
tbrowder m: say $*TZ 16:54
camelia 7200
tonyo way wrong, i'm minus double that 16:55
tbrowder heh, morning, tonyo ! 16:56
tonyo how's it going? 16:57
tbrowder can you imagine a situation where a "normal" system doesn't provide a timezone number?
going well, thank you. using yr cro/apache cookbook is on my TODO list 16:59
tbrowder i'm working on a subclass of DateTime and trying to figure how much faith to put into $*TZ as a reasonable indicator of longitude (center of 15 degree slices, that is) 17:01
my gut tells me to rely on it but let the user know about it during or after installation 17:04
the longitude is in lieu of having a suitable db of world timezone info 17:05
i've looked at DateTime::Timezones but i'm not sure it's in a convenient format 17:06
guifa_ the problem with using the number as representative of longitude is that many parts of the world run far off from their "natural" time 17:09
tbrowder what i'm doing at the moment is taking local time from DateTime (default is UTC) and letting the user enter an abbeviation for his TZ and offer to incorporate that info into my own db 17:10
guifa_ Olson IDs will get you much closer, since they're designed to be anchored to large population centers (which are more stable than, say, countries) 17:11
tbrowder guifa_: yes, and i'm not sure how best to handle it, though. unless there is a system value of lat/long, user entry is probably the way i'll go. 17:13
Nemokosch +1 for guifa
guifa_ WIth that, the Europe/Madrid will get you a much more accurate rendition of location for someone in GMT+1 than someone in Europe/Bratislava
plus DST might make someone appear to jump around 17:14
tbrowder i have 99+ percent of US covered, for now i'm allowing user to enter tz abbrev and taking his system $*TZ for the "truth" 17:16
hm, i forgot about %ENV<TZ> to get the full name, gotta go back to DateTime::TimeZones... 17:20
thanks for the inspiration, gang 17:21
guifa_ You could also use
raku.land/github:alabamenhu/UserTimezone
I have an update I need to publish 17:22
tbrowder uh, that's DateTime::TimeZone
guifa_ No, that just gets you the name of their timezone
it doesn't have any dependencies 17:23
tbrowder does alabamenhu's module have dst info? 17:27
guifa_ I can't remember which module I put the code in (and I might not have released it) that converts timezone ids to the more common language ones (e.g. "Eastern standard time") but I haven't had too much time to take a look at those recently, sadly
DST can be calculated from the timezone ID + the time. That info is in Timezones::ZoneInfo 17:28
but I haven't made it very userfriendly yet 17:29
basically, feed in a UNIX-epoch time and the zone data, and it'll provide a tm struct that gives you the date/time with a flag for DST 17:30
e.g. 17:31
tbrowder erg, i think i'll wait unless i can grok it 17:32
guifa_ my %data = calendar-from-posix(now.to-posix, timezone-data user-timezone)
%data<dst> # 0 = standard, 1 = daylight savings 17:33
%data<gmt-offset> # offset in seconds
Nemokosch isn't alabamenhu the same person as guifa for all intents and purposes? 😄 17:34
guifa_ %data<tz-abbr> # common abbreviation (e.g. "CST" "EDT")
Nemokosch we are :-)
tbrowder i think so, but he's been confusing me for years and i forget that. 17:35
Nemokosch 😂 17:36
guifa_ someone namesquats me on github and the world goes to hell lol 17:38
tbrowder ok, i will try the module, oops, test failure 17:40
guifa_ hmmm 17:41
i'll try to take a look at it this weekend
sorry new job and moved so the past few months I've been very behind on Raku dev stuff =/ 17:42
Nemokosch which module? 17:45
UserTimezone installed ok for me
tbrowder i just tried Timezones::ZoneInfo as suggested above 17:46
Nemokosch okay... also installed correctly for me 17:48
tbrowder do you have latest zed? 17:49
guifa_ what was the error? I'll try to track it down if I can
tbrowder *zef
oops, too many servers, updating zef now... 17:51
sjn hey, when's the next rakudo release? I see the last one was 2022.07 :-( 17:54
tbrowder t/03-warn.t failed
sjn: hi, i think there are some stoppers 17:55
sjn oh noes!
for two months? must have been serious o_O 17:56
tbrowder guifa_: test 03-warn.t failed 17:57
gotta go for now, back later
Nemokosch with what values?
tbrowder only error specific i see is no plan in outptu (zef --debug) 18:10
*output
Nemokosch hm, interesting 18:15
I remember there was a broken TAP version, the only thing I'd know with failing tests
guifa_ ah, I guess I should throw in an actual test in there. But historically that's not caused any problems.