![]() What we consider to be “local” time-that is, that time with an associated time zone-Noda Time calls “zoned time,” as opposed to what Noda Time considers “local” time, which is without any time zone attached (more on this later). In Noda Time, this representation is reflected as “global” time, meaning a moment on a universal timeline with which everyone agrees. In other words, it’s not that time itself is relative, it’s that our representation of time is relative. But my computer doesn’t really understand time zones, per se-it reports the time it’s been set to, which in this case is 7 p.m., despite the fact that it’s the exact same moment in time for all of us around the world. We all get that-that’s the magic of time zones. for my travel agent in Dallas and 10 p.m. for all of us in Seattle, but it’s 8 p.m. (that’s 1900 to you European folks) here in Seattle, then it’s 7 p.m. The first thing to realize is that, with all due respect to Einstein’s theories, you don’t have to be approaching light speed to realize that time is relative. NET library.Įnough preamble: Do an “Install-Package NodaTime” (notice no space between “Noda” and “Time”), and let’s look at some code. ![]() Jon Skeet, the author of Noda Time, based it on the algorithms and concepts in Joda Time, but built it from the ground up as a. NET Framework port of the Java “Joda Time” project, which itself was designed as a replacement for the Java “Date” class (a horribly broken piece of software dating back to the days of Java 1.0). NET community benefits from work done by the Java community in this case, it’s a package called “Noda Time,” a Microsoft. In keeping with the theme of my past two columns (all my columns can be found at bit.ly/ghMsco), once again the. Time in a software system is like that-it all seems pretty straightforward and simple, until it suddenly doesn’t anymore. time zone, the time logs were all a little “off,” thanks to the fact that we hadn’t thought to include time-zone offsets. Except, as we discovered later, when the system was deployed to four different call centers, each in a different U.S. Keeping track of “when” an event occurred was particularly important (it was a medical-related system for a call center of nurses), and so, without thinking about it too much, we dutifully wrote the time of the event into a database row and left it at that. Very early in my career, I was working on a system that ended up deploying to several different call centers. Volume 28 Number 03 The Working Programmer - Noda TimeĮver spent much time thinking about time?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |