Skip to content

Instantly share code, notes, and snippets.

@mikewebkist
Last active October 6, 2015 16:18
Show Gist options
  • Save mikewebkist/3020083 to your computer and use it in GitHub Desktop.
Save mikewebkist/3020083 to your computer and use it in GitHub Desktop.
How to see a leap second
#!/usr/bin/perl
# Run this a little before midnight UTC 6/30/2015 to see a leap second.
$x=(localtime)[0];
while(1) {
printf "%2d %s (%s)\n", $x++, scalar(localtime), time;
$x %= 60;
sleep 1;
}
@mikewebkist
Copy link
Author

The first column and the local seconds should match until midnight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment