November 2017 Archives

What Time is Midnight?

Yesterday was time change in the U. S. of A. I pulled out my iPod Touch to update a Numbers spreadsheet, and hit the "today" button to put the current date in the date column. But when I did that I got not the current date but 11 PM the previous day. Today it works as advertised.

Now, I am not privy to the internals here, but this behavior would be explained if "today" were implemented by the Objective C (or Swift, or whatever) equivalent of the following Perl:

my $date = time + $zone_offset;
$date -= $date % 86400;

This code is clean, simple, obvious ... and sub…

About Tom Wyant

user-pic Fine Perl code for over 0.005 centuries.