Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 425 426 427 428 429 430 431 432 433 434 435 .. 17997
1,799,659 events total
2021-06-13 04:01:40 <janus> arahael: you don't have to "convert" calendars afaik, because the iso8601 parser will know that it is parsing a gregorian date
2021-06-13 04:02:02 <Cale> pavonia: https://groups.google.com/g/comp.os.vms/c/IMWn2Fg46VA has an answer of sorts for why it's that particular day
2021-06-13 04:02:05 <davean> arahael: the Format Day implimentation
2021-06-13 04:02:06 <janus> when you get the DayOfMonth and such, that is an integer that is also using the gregorian calendar
2021-06-13 04:02:13 <arahael> janus: Yes, that's what i was saying...
2021-06-13 04:02:15 <davean> arahael: which is how you were printing IOS8601
2021-06-13 04:02:42 <arahael> davean: I'm printing ISO 8601 by physically typing the characters in!
2021-06-13 04:02:51 <janus> arahael: but there is no conversion necessarily taking place. haskell is just abstracting the internal representation which isn't necessarily gregorian. for example a unix time isn't really gregorian
2021-06-13 04:03:26 <pavonia> Cale: Thanks. Was already reading about https://en.wikipedia.org/wiki/Great_Stink :D
2021-06-13 04:03:33 <janus> arahael: but there is no conversion necessarily taking place. haskell is just abstracting the internal representation which isn't necessarily gregorian. for example a unix time isn't really gregorian know what it means?
2021-06-13 04:03:36 <arahael> janus: I think we got our signals mixed up. Cale brought up 'toGregorgian", which turned out to be exactly what I wanted... I was saying I only dismissed that when reading the docs the first time because... I was *already* using gregorian!
2021-06-13 04:03:53 <monochrom> Haha I should have become an astronomer. My day starts at noon.
2021-06-13 04:04:15 <janus> araheal: but how do you know you were already using gregorian? the Day doesn't say that it is using that internally
2021-06-13 04:04:27 <monochrom> But I can be talked into "you were right to join computer science instead, CS grad student day starts at 4PM"
2021-06-13 04:04:27 <arahael> janus: Because I'm typing in the ****'ing date myself in gregorigan! :)
2021-06-13 04:04:47 lavaman joins (~lavaman@98.38.249.169)
2021-06-13 04:04:59 × fizbin quits (~fizbin@2601:8a:4080:1280:d58e:2782:3061:3fa3) (Ping timeout: 252 seconds)
2021-06-13 04:05:22 <janus> arahael: but how? the Day constructor takes a ModifiedJulianDay
2021-06-13 04:05:40 × pe200012 quits (~pe200012@183.63.73.36) (Ping timeout: 272 seconds)
2021-06-13 04:05:44 <arahael> janus: Yes. Perhaps I should have just ignored hackage and read the source code myself.
2021-06-13 04:06:01 <janus> so if you're typing a iso8601 and parsing that, you're only using gregorian because that is what iso8601 uses. but when you got your Day, you forgot about the fact that it was ever a gregorian
2021-06-13 04:06:47 <arahael> janus: Yeah, well, I didn't have my Day, I had a LocalTime.
2021-06-13 04:07:25 × derelict quits (~derelict@user/derelict) (Ping timeout: 272 seconds)
2021-06-13 04:08:18 <arahael> janus: And Day is documented in a completely different place. :) I was wondering: "Do I need to convert this to a UnixTime?".
2021-06-13 04:09:38 <arahael> janus: I also checked stackoverflow and other places, look at how much *code* is in https://stackoverflow.com/questions/4174372/haskell-date-parsing-and-formatting
2021-06-13 04:11:17 <arahael> Do we have a wiki or something where we consolidate all this documentation so that it's clearer to navigate/
2021-06-13 04:11:19 <arahael> ?
2021-06-13 04:11:41 <janus> there is wiki, it is easy to get a user
2021-06-13 04:11:49 <janus> or you can just send me some content and i can make a page for you
2021-06-13 04:12:26 <janus> you can also ask an SO question and answer it yourself, i kinda like that model
2021-06-13 04:14:23 <arahael> Perhaps I should think about doing a decent tutorial on the wiki.
2021-06-13 04:14:31 × ubikium quits (~ubikium@113x43x248x70.ap113.ftth.arteria-hikari.net) (Ping timeout: 272 seconds)
2021-06-13 04:15:02 ubikium joins (~ubikium@2400:2200:3f1:982e:b73d:c88d:7f8e:831b)
2021-06-13 04:16:02 <Cale> arahael: Yeah, the time library is actually really good and has most of what you'd ever need, but it takes a moment to get used to :)
2021-06-13 04:16:28 <janus> arahael: there is also a wikibook on haskell, you could add a chapter
2021-06-13 04:16:40 <arahael> janus: Another possibility.
2021-06-13 04:16:53 <arahael> Cale: Yeah, it's definitely not easy to dive in and see everything.
2021-06-13 04:17:50 <janus> check out this diagram https://wiki.haskell.org/File:Time-diagram.png
2021-06-13 04:17:59 reumeth joins (~reumeth@user/reumeth)
2021-06-13 04:18:49 <davean> I don't think that diagram is quite right
2021-06-13 04:19:07 <janus> looks weird with "Day - Day" not being Void :P
2021-06-13 04:19:21 <arahael> janus: The best thing about that particular diagram is the "The following pages link to this file:", bringing up the Time docs.
2021-06-13 04:19:31 thelounge92 joins (~thelounge@cpe-23-240-28-18.socal.res.rr.com)
2021-06-13 04:19:34 <arahael> janus: All my searching was focused on either date, or datetime!
2021-06-13 04:19:42 <arahael> Those time docs are quite good.
2021-06-13 04:19:58 <davean> Pretty sure that diagram screws up the relation between AbsoluteTime and UTCTime janus
2021-06-13 04:20:18 <janus> i wouldn't call them docs on the wiki :P i mean, the diagram is on there
2021-06-13 04:20:40 <janus> would suck to make a library only for someone to make a bad diagram , put it on the wiki page, and now people tell you that your docs suck :P
2021-06-13 04:21:14 <janus> davean: thanks for the pointers! a shame, i like diagrams :P
2021-06-13 04:21:22 <arahael> janus: The back link is docs. :)
2021-06-13 04:21:37 <arahael> janus: https://wiki.haskell.org/Time
2021-06-13 04:22:18 <davean> janus: there is a function AbsoluteTime -> UTCTime but no map UTCTime -> AbsoluteTime specificly
2021-06-13 04:22:24 <janus> but documentation written mostly by Russell O'Connor in 2013. when people say "docs" don't they usually talk about the official ones?
2021-06-13 04:22:42 × tomsmeding quits (~tomsmedin@2a03:b0c0:0:1010::767:3001) (Quit: ZNC 1.8.2 - https://znc.in)
2021-06-13 04:23:20 <davean> janus: Some UTCTimes map to multiple AbsoluteTimes
2021-06-13 04:23:29 <davean> since UTCTime isn't monotonic
2021-06-13 04:24:24 <janus> why is UTC not monotonic? because of leap seconds?
2021-06-13 04:24:27 Morrow_ joins (~MorrowM_@bzq-110-168-31-106.red.bezeqint.net)
2021-06-13 04:24:29 <davean> janus: yes
2021-06-13 04:24:41 <davean> which can go forward or backwards, so UTCTime repeats
2021-06-13 04:25:00 <janus> i wish there was a name for UTC-with-time-smearing?
2021-06-13 04:25:10 <davean> I mean just use AbsoluteTime
2021-06-13 04:25:13 <davean> TAI is pretty easy
2021-06-13 04:25:21 <davean> And its far more correct
2021-06-13 04:25:37 <davean> UTCTime is for display to humans
2021-06-13 04:25:45 <davean> computers should always just use time in TAI
2021-06-13 04:26:09 <arahael> janus: At this point, I'd have been happy with *any* docs. The hackage modules barely refer to each other except when they happen to use a type in another module.
2021-06-13 04:26:49 <janus> davean: ok, but in practice, if they don't use TAI , and they use UTC with time smearing, wouldn't it be easier to invent a new correct name for this variant, instead of rewriting everything to use TAI?
2021-06-13 04:27:03 <davean> janus: smearing varies
2021-06-13 04:27:06 <davean> so no, it wouldn't
2021-06-13 04:27:12 × MorrowM quits (~MorrowM_@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 272 seconds)
2021-06-13 04:27:12 <davean> smearing is a huge mess
2021-06-13 04:27:21 <davean> So I just check the time at the time, and convert into TAI
2021-06-13 04:27:30 <davean> computers DO keep a monotonic clock
2021-06-13 04:27:35 <davean> since they can't possibly keep UTC correctly
2021-06-13 04:27:43 <davean> so I just access the monotonic clock, and get TAI out
2021-06-13 04:28:43 × hmmmas quits (~chenqisu1@183.217.200.246) (Quit: Leaving.)
2021-06-13 04:28:54 <janus> "TAI clock, if it exists. Note that it is unlikely to be set correctly, without due care and attention."
2021-06-13 04:28:57 × Morrow quits (~Morrow@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 272 seconds)
2021-06-13 04:28:58 <janus> from https://hackage.haskell.org/package/time-1.12/docs/Data-Time-Clock-TAI.html
2021-06-13 04:29:18 <davean> sure, which is why I use https://hackage.haskell.org/package/tai instead of time
2021-06-13 04:29:33 <janus> oh my
2021-06-13 04:29:39 <davean> That deals with the system details
2021-06-13 04:29:51 <janus> oh it's your own library :D
2021-06-13 04:29:54 <davean> Yes
2021-06-13 04:29:59 <davean> I've dealt with the time issues a lot
2021-06-13 04:30:16 <janus> space traveller?
2021-06-13 04:30:34 <glguy> aren't we all?
2021-06-13 04:30:35 <davean> as I said, the systems use mononic time, rarely TAI
2021-06-13 04:30:42 <davean> they present UTCTime
2021-06-13 04:30:57 <davean> You just have to align them
2021-06-13 04:31:07 <davean> janus: a second is a huge amount of time
2021-06-13 04:31:17 <davean> a smeared second causes a TON of issues
2021-06-13 04:31:34 <arahael> A second is long enough to crash all the eftpos terminals in my state. :)
2021-06-13 04:31:49 <davean> it might be mononic and continuous but it either drops a second or packs two times as much in
2021-06-13 04:31:56 × justBull quits (~justache@user/justache) (Excess Flood)
2021-06-13 04:31:59 <davean> arahael: right, a second is a big deal :)
2021-06-13 04:32:42 <janus> but isn't the whole point of time smearing that it is smeared out over such a long period that the delta will never grow close to a second?
2021-06-13 04:32:45 justBull joins (~justache@user/justache)
2021-06-13 04:32:49 teaSlurper joins (~chris@81.96.113.213)

All times are in UTC.