-
Notifications
You must be signed in to change notification settings - Fork 1
recapupload: date tz workaround #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Don't report the date to CourtListener in UTC, convert to the local zone. Fortunately (today) we only care about dates, not times, so this isn't so serious. [But we should care about times!] Unfortunately recapupload doesn't know what timezone each court is in, so converting to local time is hard. But as a compromise, convert to US/Pacific, which is less wrong (and a 10pm Pacific filing is much more likely than a 1am Eastern filing). Also, unfortunately, the only way to control the local zone is to set the TZ environment variable and call tzset(). And then we have to put it back in case there are others in the same process who use time localization.
|
I just realized this is in your repo not one that I do PR reviews for. Did you actually want me to review this PR or did I just come up with that in my head? |
Well, I said:
So yes, I sought your review |
|
Seems like we'll need the full lookup table fairly soon for RSS parsing, and that it's the right way to do this. It probably isn't terribly hard to do...just have to think through 200 courts, I guess. We could split it up if you want? |
|
You define the object you want to make — a dict? — and tell me which ones you want me to do, and I'll crank through 'em. |
That's a bit silly. There are 204 ECF courts at https://www.pacer.gov/psco/cgi-bin/links.pl. With a few exceptions (appeals courts and So this just reduces to the mapping of timezones by state. Curiously at least 1 court publishes its timezone information in the CourtInfo.pl page, e.g.: <Locations>
<name>USDC Northern Indiana</name>
<address>1300 South Harrison Street, Room 1108, Fort Wayne, IN 46802</address>
<email>fwclerks&#064;innd.uscourts.gov</email>
<hours>9:00 a.m. to 4:00 p.m. Eastern time</hours>
<phone>260-423-3000 or 800-745-0265</phone>
</Locations>(God knows what happens if different divisions of a court have offices in different timezones.) Edit: Err, crap. Like, in fact, this one:
Research question! Anyhow, getting back to the initial question:
I read your answer as to say it's silly to apply this workaround and let's fix it "right" (with a table). I dunno if I should close this PR and open a new one for the table-based fix. But I was hoping for feedback on the |
|
Here's a lookup function (which is not exactly the same as a table): I'm not really confident this was the right architecture. |
Don't report the date to CourtListener in UTC, convert to the local zone.
Addresses #4.
Fortunately (today) we only care about dates, not times, so this isn't so
serious. [But we should care about times!]
Unfortunately recapupload doesn't know what timezone each court is in,
so converting to local time is hard. But as a compromise, convert to
US/Pacific, which is less wrong (and a 10pm Pacific filing is much
more likely than a 1am Eastern filing).
Also, unfortunately, the only way to control the local zone is to set
the TZ environment variable and call tzset(). And then we have to put
it back in case there are others in the same process who use time
localization.
The more I think about it, the more I am skeptical this is the right way to go and we should just bite the bullet and do the table lookup. Although that doesn't avoid the timezone code ugliness.
Thoughts on that or other aspects welcome. Esp. @mlissner.