Editing 1467: Email
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== | ||
− | + | 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]] is visibly appalled and wonders how else he expects electronic messages to be sent. She attempts to explain that, unlike {{w|voicemail}}, email must be checked regularly, though her reasoning is unclear. | |
− | + | Beret Guy offers two alternatives: {{w|Fax}} and {{w|Snapchat}}. Megan points out that Snapchat has been primarily used to send naked pictures over the Internet, to which Beret Guy asserts that faxes have also been used in a similar way - referring to this practice as "faxting" (a made-up term similar to {{w|sexting}}). | |
− | + | The title text, which could be [[Randall]]'s New Year's resolution for 2015, refers to various date/time formats. In programming, a specific time (most often the current system time) is usually stored and processed as a single number that represents the count of seconds since a given starting time (eg. January 1, 1970 at midnight). In order to make sense to people, this number must be converted to a human-readable format. However, numerous standard formats exist that all express the date and time differently. Programmers often must decide between using the commonly-used format for a given region (eg. "Month/Day/Year" in the United States) or a format that can be easily sorted (eg. "Year/Month/Day") but might not be as easy to understand. They also usually must decide whether the given date/time is expressed in the user's local time zone (eg. Pacific Standard Time) or in {{w|Universal Time}}, whether to include millisecond precision or to include the time at all, etc.. | |
− | + | Most programming languages provide generic 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 to format the then-current time with the string: "%Y-%M-%D %h:%m:%s". He apparently expected his string to be in the format "Year-Month-Day Hour:Minute:Second", but he used the wrong tokens for this: | |
− | + | *%Y = 4-digit year | |
+ | *%M = minute | ||
+ | *%D expands to %m/%d/%y, which is "month/day/(2-digit)year" in the user's local time zone rather than UTC. | ||
+ | *%h = abbreviated month name | ||
+ | *%m = 2-digit month | ||
+ | *%s = Unix timestamp (count of 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 {{w|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, which is evidently at least 5 hours off from UTC. (In Pacific Standard Time, for example, the time was 20:54:02, or just before 9:00 PM, on the previous day.) | |
− | + | The correct formatting string for Randall's apparent desired result is "%Y-%m-%d %H:%M:%S", which gives the string "2014-12-31 04:54:02". 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | The correct | ||
Randall previously addressed date/time formatting in [[1179: ISO 8601]] and [[1340: Unique Date]] (the latter of which uses a formatting string correctly). | Randall previously addressed date/time formatting in [[1179: ISO 8601]] and [[1340: Unique Date]] (the latter of which uses a formatting string correctly). | ||
− | |||
− | |||
==Transcript== | ==Transcript== | ||
Line 56: | Line 50: | ||
==Trivia== | ==Trivia== | ||
− | The Unix timestamp is a standard method of | + | The Unix timestamp is a standard method of describing the absolute number of seconds that have elapsed since "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. To convert that into a human-readable time: | |
− | The timestamp in this comic's title text (1420001642) is 1,420,001,642 seconds since epoch. | + | ** Years = 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'''. | ||
+ | ** Number of days = 31,467,242 seconds / 60 seconds per minute / 60 minutes per hour / 24 hours per day | ||
+ | *** This yields 364 days plus 17,642 seconds. | ||
+ | *** The 364th 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 = 17,642 seconds / 60 seconds per minute / 60 minutes per hour = '''4 hours''' plus 3,242 seconds | ||
+ | *** Minutes = 3,242 seconds / 60 seconds per minute = '''54 minutes''' plus 2 seconds | ||
− | + | Thus, Randall's timestamp represents the time "2014-12-31T04:54:02Z" (again in ISO-8601 format). | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Thus, Randall's timestamp represents the time " | ||
{{comic discussion}} | {{comic discussion}} | ||
− | |||
− | |||
[[Category:Comics featuring Beret Guy]] | [[Category:Comics featuring Beret Guy]] | ||
[[Category:Comics featuring Megan]] | [[Category:Comics featuring Megan]] | ||
− |