{"id":1040,"date":"2018-10-10T19:57:22","date_gmt":"2018-10-11T02:57:22","guid":{"rendered":"http:\/\/briancebuhl.com\/?p=1040"},"modified":"2018-10-10T19:57:22","modified_gmt":"2018-10-11T02:57:22","slug":"write-what-you-know-time-zones-and-daylight-savings","status":"publish","type":"post","link":"https:\/\/briancebuhl.com\/?p=1040","title":{"rendered":"Write What You Know: Time Zones and Daylight Savings"},"content":{"rendered":"<p>Tonight I&#8217;m going to talk about time zones and daylight savings.\u00a0 Before I dive into it, I want to take a quick moment to check in with you guys.<\/p>\n<p>&nbsp;<\/p>\n<p>Hey there.\u00a0 You doin&#8217; okay?\u00a0 Haven&#8217;t seen you around that much.\u00a0 I get worried.<\/p>\n<p>&nbsp;<\/p>\n<p>We&#8217;re about a third of the way through Blogtober and I think some of my posts this month are really good.\u00a0 It&#8217;s a little bit stressful getting a blog entry posted each night, but it gets me in the frame of mind to write something daily.\u00a0 That&#8217;s perfect preparation for next month.<\/p>\n<p>I am a little weary writing all these blog posts, and it looks like you guys are a little tired of seeing one every night, too.\u00a0 That&#8217;s okay!\u00a0 They&#8217;ll still be here for later.\u00a0 I have to remember that much of this Blogtober exercise is just to get me ready for next month.\u00a0 You know what happens next month, right?\u00a0 Bunches of us try to write 50,000 words in 30 days.<\/p>\n<p>Do you know what else happens next month?\u00a0 The time changes (for most of us) on November 4th!<\/p>\n<p>And that leads perfectly into tonight&#8217;s subject, and is not a forced segue at all.<\/p>\n<p>&nbsp;<\/p>\n<p>To write tonight&#8217;s post, I&#8217;m going to try something different.\u00a0 I&#8217;m going to build this up as if it were a Q &amp; A.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: Why are we discussing time zones tonight?\u00a0 No one cares about time zones.<\/strong><\/p>\n<p>Okay, first of all?\u00a0 Why all the attitude in the first question?\u00a0 Second, lots of people care about time zones.\u00a0 They&#8217;re called programmers, and they&#8217;re fantastic.<\/p>\n<p>This was actually the first topic I came up with for this month.\u00a0 I thought of it because at work, I seem to be the only person that seems to understand how time zones work.\u00a0 Since I&#8217;m a writer, and we&#8217;re always told to write what we know, I thought I&#8217;d bring some of my expertise on the subject to you.<\/p>\n<p>Also, it&#8217;s Wednesday night and I want a topic which won&#8217;t become a 2,000 word essay.\u00a0 I want to have time to write something real tonight.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: I already know what time zones are.\u00a0 There isn&#8217;t anything to discuss.<\/strong><\/p>\n<p>Dude, that wasn&#8217;t even a question.\u00a0 You&#8217;d be terrible at Jeopardy.<\/p>\n<p>But you&#8217;re right in that conceptually, they&#8217;re not that complicated.\u00a0 Depending on where you live, your clock is going to be some number of hours or minutes off from someone that lives far enough east or west of where you are.\u00a0 There isn&#8217;t that much to discuss.<\/p>\n<p>Nevertheless, as the world has become smaller and smaller thanks to the internet, time zones affect our daily lives more and more.\u00a0 Do you live on the West Coast and want to talk to your friend on the East Coast?\u00a0 If you&#8217;re a good friend, you&#8217;re doing some math in your head when you look at the clock to make sure you&#8217;re not calling in the middle of the night.<\/p>\n<p>More and more, I find that I have friends in New Zealand or the UK or other places far enough away that our hours of wakefulness barely overlap.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: Okay, so what&#8217;s your point?<\/strong><\/p>\n<p>My point is that as a programmer that deals with time sensitive information, it&#8217;s interesting.\u00a0 Also, this is a subject that isn&#8217;t well represented in a lot of fiction.\u00a0 If you&#8217;re going to put your stories in space, you might want to have an idea how time zones work.\u00a0 I&#8217;m here to help you with some of the math, and to show you the kind of stuff I have to explain to my coworkers every damn day.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: I didn&#8217;t come here to learn math&#8230;<\/strong><\/p>\n<p>Let&#8217;s look at some examples of textual representations of time.<\/p>\n<pre>6:40<\/pre>\n<p>I looked at the clock on my computer, and that&#8217;s what I saw at a glance.\u00a0 That&#8217;s what a lot of people see when they look at their watches or phones.\u00a0 The problem is that it isn&#8217;t specific enough to be useful.\u00a0 This example doesn&#8217;t even give AM or PM.\u00a0 It&#8217;s non-information.<\/p>\n<pre>6:40 PM<\/pre>\n<p>Okay, that&#8217;s better.\u00a0 But really, that&#8217;s still not enough to work with.\u00a0 If you ask your bank when they plan to post a check to your account and they give you that information&#8230; well, there&#8217;s an implication they mean TODAY at 6:40PM.\u00a0 But the implication itself is enough to show you that you need more than the hours on the clock to get exact time.\u00a0 You need the date.<\/p>\n<pre>Oct 10, 6:40 PM<\/pre>\n<p>See, that&#8217;s still not enough&#8230;<\/p>\n<pre>Oct 10, 2018, 6:40 PM<\/pre>\n<p>You&#8217;d THINK that would be enough information.\u00a0 Hell, some of the vendors we deal with which feed us time-stamped information think that&#8217;s enough.\u00a0 But just like the hypothetical call to the bank, the only way for that information to be useful is to assume the time zone is the same as yours.\u00a0 And you know what happens when you go assuming?\u00a0 You make an ass out of you and some guy named Ming.<\/p>\n<p>In Sacramento, the full time stamp would be:<\/p>\n<pre>Oct 10, 2018, 6:40 PM -07:00<\/pre>\n<p>That &#8220;-07:00&#8221; represents Pacific Daylight Time (PDT).\u00a0 It means that during daylight savings, Sacramento is 7 hours less than Greenwich Mean Time (GMT).<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: Why do we base our time zones around GMT?<\/strong><\/p>\n<p>Here, <a href=\"http:\/\/lmgtfy.com\/?q=Why+is+time+set+from+Greenwich%3F\" target=\"_blank\" rel=\"noopener\">click this link<\/a>.<\/p>\n<p>I&#8217;m not really getting into the history of GMT and time zones as much as the functionality.\u00a0 But basically, Greenwich was considered longitude 0, and things go from there.<\/p>\n<p>Where it gets interesting is when you add daylight savings.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: I already know about daylight savings.\u00a0 It&#8217;s Spring forward, Fall back.<\/strong><\/p>\n<p>Right.\u00a0 And this year, &#8220;Fall back&#8221; occurs on November 4th at 2 AM.<\/p>\n<p>Imagine that you have a spreadsheet and you&#8217;re tracking the mating habits of the rare crimson cricket, a nocturnal animal.\u00a0 You have your low light cameras equipped and you&#8217;re making notes in a spreadsheet.\u00a0 You&#8217;re dressed for a night op mission, but you&#8217;re watching insects fornicate like some kind of Jiminy Cricket voyeur.<\/p>\n<p>In the first column of your spreadsheet, you&#8217;re keeping track of time.\u00a0 I don&#8217;t know what you&#8217;re putting in the other columns.\u00a0 Position?\u00a0 Technique?\u00a0 This is your weird science experiment, not mine.<\/p>\n<p>Let&#8217;s say you&#8217;re doing this experiment on November 4th, 2018.\u00a0 What does your spreadsheet look like as you cross into 3 AM?\u00a0 Probably something like this:<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td>02:15 AM<\/td>\n<td>Heavy chirping<\/td>\n<\/tr>\n<tr>\n<td>02:35 AM<\/td>\n<td>More chirping, some slow dancing<\/td>\n<\/tr>\n<tr>\n<td>02:45 AM<\/td>\n<td>Mild preening<\/td>\n<\/tr>\n<tr>\n<td>02:55 AM<\/td>\n<td>Heavy preening<\/td>\n<\/tr>\n<tr>\n<td>02:05 AM<\/td>\n<td>Significant wing action<\/td>\n<\/tr>\n<tr>\n<td>02:15 AM<\/td>\n<td>Cuddle time<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>See what happened?\u00a0 You&#8217;ve got two entries for 2:15 AM.\u00a0 You can&#8217;t go straight from chirping to cuddle time!<\/p>\n<p>Whatever the subject you&#8217;re recording, if it&#8217;s time sensitive data, and if it&#8217;s going into a database or spreadsheet, it&#8217;s very important that the time column is clear and doesn&#8217;t overlap.\u00a0 In the Spring, you might be able to get away with the gap as you go straight from 1:59 AM to 3:00 AM.\u00a0 But in the Fall?\u00a0 It&#8217;s madness!<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: Madness?\u00a0 THIS. IS. SPARTA!!<\/strong><\/p>\n<p>Sparta, by the way, is in Central Daylight Time.\u00a0 That&#8217;s 2 hours ahead of California, or -05:00 as of the time of this writing.\u00a0 I&#8217;m talking about Sparta, Tennessee.<\/p>\n<p>If you&#8217;re in California and you head east, the time on your clock is going to go up for every time zone you cross.\u00a0 You&#8217;re also getting closer to GMT, which means the difference is going down.\u00a0 California in October is -7 hours.\u00a0 Utah is -6 hours.\u00a0 Tennessee is -5 hours.<\/p>\n<p>All of the following times are equivalent, referencing the exact same moment in time:<\/p>\n<pre>Oct 10, 2018, 6:40 PM -07:00\r\nOct 10, 2018, 7:40 PM -06:00\r\nOct 10, 2018, 8:40 PM -05:00\r\nOct 11, 2018, 1:40 AM +00:00<\/pre>\n<p>If you&#8217;re a programmer, you have to get used to this kind of thinking when it comes to dealing with time.\u00a0 When you store the data in a database or spreadsheet, you either need to convert everything to GMT first, or you need to include the time zone with the data.\u00a0 In SQL Server, the data type that does this for you is a DateTimeOffset.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: But I&#8217;m a writer, not a programmer.\u00a0 I don&#8217;t care about databases or the fornicating habits of crickets.<\/strong><\/p>\n<p>That&#8217;s cool!\u00a0 I&#8217;m a writer, too.\u00a0 If you write sci-fi like me, you may want to consider time zones in your world building.<\/p>\n<p>Look at it like this.\u00a0 On Earth, we have a lot of languages [<span style=\"color: #3366ff;\">citation needed<\/span>].<\/p>\n<p>What do they speak on Klingon?\u00a0 On Vulcan?\u00a0 on Corellia?<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Q: They speak Klingon, Vulcan, and Corellian.<\/strong><\/p>\n<p>That was a trick question because in practice, they mostly speak English.\u00a0 But you get the idea.\u00a0 If we want rich worlds that are believable, worlds so well drawn that it seems like we should be able to open the book and step right into them, shouldn&#8217;t we include details like different dialects?<\/p>\n<p>Maybe we should consider the idea that even though it&#8217;s 6:40 PM on the ship orbiting the planet, it&#8217;s only 5:30 AM where the away team has landed.\u00a0 If the away team isn&#8217;t thinking of it, I know damn well that the programmers on the ship are having to keep track of that information.\u00a0 We have to.\u00a0 It&#8217;s part of the job.<\/p>\n<p>&nbsp;<\/p>\n<p>And that&#8217;s it!\u00a0 You&#8217;re armed now!\u00a0 Go forth and write a post about space programmers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tonight I&#8217;m going to talk about time zones and daylight savings.\u00a0 Before I dive into it, I want to take a quick moment to check in with you guys. &nbsp; Hey there.\u00a0 You doin&#8217; okay?\u00a0 Haven&#8217;t seen you around that much.\u00a0 I get worried. &nbsp; We&#8217;re about a third of the way through Blogtober and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1040","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/briancebuhl.com\/index.php?rest_route=\/wp\/v2\/posts\/1040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/briancebuhl.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/briancebuhl.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/briancebuhl.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/briancebuhl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1040"}],"version-history":[{"count":1,"href":"https:\/\/briancebuhl.com\/index.php?rest_route=\/wp\/v2\/posts\/1040\/revisions"}],"predecessor-version":[{"id":1041,"href":"https:\/\/briancebuhl.com\/index.php?rest_route=\/wp\/v2\/posts\/1040\/revisions\/1041"}],"wp:attachment":[{"href":"https:\/\/briancebuhl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/briancebuhl.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/briancebuhl.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}