Editing 1467: Email

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
  
 
==Explanation==
 
==Explanation==
A [[:Category:New Year|New Year comic]], where [[Megan]] asks [[Beret Guy]] if he has any {{w|New Year's resolutions}}, and even though this is just before {{w|new year}} 2015, his resolution is to find out what an email is!
+
{{incomplete|Created for a live studio audience. - Please change this comment when editing this page.}}
 +
Beret guy doesn't seem to know what email is, even though the term has existed since 1993, and been in use by the general public since 1998 when free email providers appeared. Megan is visibly appalled and wonders how else he expects electronic messages to be sent. Beret guy offers two alternatives: fax and snapchat. When Megan tries to point out that snapchat is mostly used to send naked pictures, Beret guy takes her to mean that fax is mostly used to send naked pictures. He terms this use of faxes faxting, a made-up word by analogy with sexting.
  
Despite being in popular use since 1998 when free email providers appeared and having existed since before 1982 when {{w|SMTP}} was established, Beret Guy apparently doesn't understand what {{w|email}} is, even though he maintains a web page that includes his email address. Megan wonders how else he expects electronic messages to be sent. She explains that one must check email regularly, making a slight at {{w|voicemail}}, which she implies is not worth ever checking.
+
The mouseover text shows what is possibly Randall's new years resolution: to learn how to use time formatting functions. When programming, it is often useful to obtain the current time by means of a time function. However, these time functions often provide more detail than what the programmer needs, such as time zone and milliseconds. Time formatting functions allow the output of the time function to be converted into what the programmer needs. Randall appears to have used a time function to get the current date, probably with the formatting string "%Y-%M-%D %h:%m:%s", which looks like it should give year-month-day hour:minute:second, but when parsed by standard unix routines gets interpreted as follows:
  
Beret Guy offers two alternatives: {{w|Fax}} and {{w|Snapchat}}. Megan refers to Snapchat as "the naked pic thing", calling to mind how many of its users send naked pictures of themselves over the Internet. Beret Guy replies that people use fax machines for more than just "faxting" (a made-up term similar to {{w|sexting}}), implying not only that many people send sexual content via fax, but also that he associates fax machines with such acts rather than Snapchat, despite faxing being a technology that predates SMTP by more than a century. Beret Guy knows what a fax is, which implies he is very behind in the technology world, so it makes sense he doesn't know what email is. But he also knows what Snapchat is, which was very popular around the time of this comic. Either Beret Guy heard about it in a similar way to email, or he definitely knows what it is and/or uses it. What's strange is that if Beret Guy knows what Snapchat is, he should know what email is as well, since you need to provide an email account in order to create a snapchat account.
+
%Y is 4-digit year
 +
%M is minute
 +
%D is the same as %m/%d/%y, i.e. month/day/(2-digit)year
 +
%h is the abbreviated month name
 +
%m is 2-digit month
 +
%s is the unix timestamp
  
The title text, which could be [[Randall]]'s New Year's resolution for 2015, refers to various date/time formats. In programming, a point in time (e.g. the current system time) is usually stored and processed as a single number that represents the count of seconds that have elapsed since a given starting time known as "epoch" (the Unix standard epoch is January 1, 1970 at midnight, {{w|UTC}}). In order to make sense to people, this number must be converted to a human-readable format, but programmers must choose a format that best meets the needs of their users. This can be a complicated problem to solve, given that there are many different standard formats for different regions, different levels of precision for different applications, and differences between "universal time" and a user's local time zone. Randall has previously advocated for widespread adoption of the {{w|ISO 8601}} format as a universal standard.
+
The unix timestamp 1420001642 corresponds to 2014-12-31 at 04:54:02 UTC, hence giving the full time string 2014-54-12/31/14 Dec:12:1420001642.
  
The title text also probably references a twitter outage that took place on December 29, which was blamed on an [http://www.theguardian.com/technology/2014/dec/29/twitter-2015-date-bug error in a date format string].
+
The correct formatting string for year-month-day hour:minute:second would be %Y:%m:%d %H:%M:%S.
 
 
Most programming languages provide functions to create a custom date-format string using "tokens" that represent different parts of the date/time. Here, Randall appears to have used one of these functions with the string "%Y-%M-%D %h:%m:%s", which looks like it should produce a date and time as "Year-Month-Day Hour:Minute:Second". However, he used the wrong tokens for this:
 
 
 
*%Y = 4-digit year (2014)
 
*%M = minute (54)
 
*%D expands to %m/%d/%y, which is "month/day/2-digit year" in the user's local time zone rather than UTC. ("12/30/14" - see below)
 
*%h = abbreviated month name ("Dec")
 
*%m = 2-digit month (12)
 
*%s = Unix timestamp (1420001642 seconds since epoch)
 
 
 
The "%s" token shows us the actual {{w|Unix time|Unix timestamp}} used (1420001642), which corresponds to 2014-12-31 at 04:54:02 UTC. The format string shown above thus yields "2014-54-12/30/14 Dec:12:1420001642". Note that the middle portion of this string shows "12/30" instead of "12/31" - this is due to the %D token expressing the date in Randall's local time zone (Eastern Standard Time, or EST), which is 5 hours before UTC. The time there was 23:54:02, or just before midnight, on the previous day.
 
 
 
The correct format string for Randall's apparent desired result is "%Y-%m-%d %H:%M:%S", which gives the string "2014-12-31 04:54:02" (UTC) or "2014-12-30 23:54:02" (EST). Given the similarity between Randall's string and the correct one, it is easy to see how this type of formatting is confusing and often frustrating for programmers - particularly those not intimately familiar with these functions.
 
 
 
Randall previously addressed date/time formatting in [[1179: ISO 8601]] and [[1340: Unique Date]] (the latter of which uses a formatting string correctly).
 
 
 
This was the second comic in a row with Megan holding a smart phone, the first being [[1466: Phone Checking]]. The comic before that one was also about smart phones: [[1465: xkcd Phone 2]].
 
  
 
==Transcript==
 
==Transcript==
Line 54: Line 43:
 
:Megan: ...The naked pic thing?
 
:Megan: ...The naked pic thing?
 
:Beret Guy: Fax machines aren't ''just'' for faxting!
 
:Beret Guy: Fax machines aren't ''just'' for faxting!
 
==Trivia==
 
The Unix timestamp is a standard method of keeping time by counting the absolute number of seconds that have elapsed since a set point in time known as "epoch", defined as midnight on January 1, 1970, Coordinated Universal Time (UTC). Epoch, in {{w|ISO-8601}} format, is "1970-01-01T00:00:00Z", where Z indicates UTC.
 
 
The timestamp in this comic's title text (1420001642) is 1,420,001,642 seconds since epoch. The process of converting that number into a human-readable time is as follows:
 
 
*Years since 1970 = 1,420,001,642 seconds / 60 seconds per minute / 60 minutes per hour / 24 hours per day / 365.25 days per year
 
**This yields 44 years plus 31,467,242 seconds.
 
**The year for the timestamp is 1970 + 44 years = '''2014'''.
 
***Note: The year calculation specifies 365.25 days per year to account for {{w|leap year|leap years}} (every fourth year adds an extra day).  Also note that 2014 is not a leap year.
 
*Days since start of year = 31,467,242 seconds / 60 seconds per minute / 60 minutes per hour / 24 hours per day
 
**This yields 364 days plus 17,642 seconds.  Given January 1 is considered the ''first'' day of the year, this means we are on the 365th day of 2014.
 
**The 365th day of a non-leap year is '''December 31'''. December is the '''12th month''' in the Gregorian calendar.
 
*The remaining seconds can be converted into a time:
 
**Hours since start of day = 17,642 seconds / 60 seconds per minute / 60 minutes per hour = '''4 hours''' plus 3,242 seconds
 
**Minutes since start of hour = 3,242 seconds / 60 seconds per minute = '''54 minutes''' plus '''2 seconds'''
 
 
Thus, Randall's timestamp represents the time "'''2014-12-31'''T'''04:54:02'''Z" (again in ISO-8601 format).
 
 
 
{{comic discussion}}
 
{{comic discussion}}
 
[[Category:New Year]]
 
 
[[Category:Comics featuring Beret Guy]]
 
[[Category:Comics featuring Beret Guy]]
 
[[Category:Comics featuring Megan]]
 
[[Category:Comics featuring Megan]]
[[Category:Email]]
 

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)