Negotiating with outsourcers.
Ukrainian developer: "Node.js, huh. What kind of bitcoin or blockchain integration do you have?"
Kill me. Kill me now.
Unix Time is, by specification, in the UTC time zone. DateTime is not. DateTime is, by specification, in the time zone currently set on the computer running the code. That's stupid, and the designers of .NET back in 2001 should have known it was stupid.
Shit, you're right.
I assumed they'd just moor the internal representation of DateTime to some specific moment in both time and space.
Reading through docs, I am not even sure what is the value they are storing. Number of tics since January 1st, year 1, and whenever 12:00 AM would be at your current location / time zone?
Without knowing the time zone associated with a DateTime, you can't place that event on a timeline with any reliability. You can't say any given DateTime occurred before or after any other given DateTime without additional data not present in the DateTime struct itself. Which is stupid.
Why couldn't you? DateTime without TZ is basically just the wrapper around "unix time". So if machine A says something happened X second after epoch and machine B says something happened Y seconds after epoch, why can't you just compare the two numbers? Why do you need TZ, which is basically just the geographic location where either A or B are located? A moment in time is the same moment for both A and B, regardless of how A and B interpret it locally.
If the DateTimes 100% stay within your app and never get send out from an API or stored in a database or written to a file, ok, maybe you can just decree "everything in this app is in UTC time zone!" and get away with it, but wouldn't it be better if the time zone was just encoded in the DateTime itself?
Yes, it'd be better. But, if you just want to know when something happened in time, not necessary.
Why convert it to a DateTimeOffset at the "last moment" when you could just keep it in a DateTimeOffset all the time? What if you forget to do it? What if you're not showing the time to a user, but saving it for later?
But wouldn't you want to convert it anyway?
If your server is in US and your user is in Europe, and you want to present a timestamp their database record was updated, why would they care about your local server timezone? They'd want to see their local time anyway. So whatever TZ got stored with your timestamp is useless anyway.
Honest question: why is it a big deal that
I am currently having one of my interns examining this problem space in his spare time. The last thing he showed me was some chrome extension that records a series of actions in browser, he then plugs this recording into his home-made converter, and it spits out js test case, to be used with some node-js based test runner.
I'll touch base with him on Monday and get more details. Keeping an eye on this thread.
Long time ago, when I was in NET land, I remember trying to do this exact thing.
It bit me in the ass. The code was flaky and difficult to debug. I ended up moving my background processing into a service and having ASP.NET talk with it through WCF.
I don't remember the details. but I think in my case, I actually tried to spawn and control threads from web requests. If you only start one thread on start and don't touch it again, you might fare better. But you'd probably still be better off keeping background processing away from your web server and in an environment that is designed to handle it.
Linux used to have excellent font rendering support thanks to a package called "infinality". But about 2 years ago, the main guy behind it disappeared off the face of Earth .
Turns out, no one knows or wants to take over the thankless task of maintaining this package, so it was left to rot. Finally, it has become so outdated, that it can no longer run on current desktops (which I've sadly come to learn when I tried to upgrade my linux).
There is no replacement for infinality. Default openblah looks fuzzy and blah. My eyes are already straining.
It's strange to think that, for a few years, linux had font rendering on par with MacOS. And now, it no longer has. One step forward, one step back.
Boss: Working with Americans is so much nicer. I got a nice professional outline, with everything they understood about the project, the suggested deliverables, everything. The <local outsourcing guy> sent me some stupid mail with a few vague bullet points, so unprofessional!
Me: (thinking of how Boss conducts his own outsourcing business and how organized *he* is) Yeah, that must suck, huh.
Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.