Skip to content

Instantly share code, notes, and snippets.

@sancome
Created April 18, 2014 06:54
Show Gist options
  • Save sancome/11028279 to your computer and use it in GitHub Desktop.
Save sancome/11028279 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Time::gmtime;
use Time::localtime;
sub gcd {
my ($a, $b) = @_;
return ( $b ? gcd($b ,$a % $b) : $a);
}
my $tm = localtime();
my $tmUTC = gmtime ();
printf("password for today is: %x%02d-%02x%02d\n"
, $tm ->mon() + 1, $tm ->mon() + 1, $tm ->mday(), gcd($tm ->mon() + 1, $tm ->mday()));
printf("password for today (UTC) is: %x%02d-%02x%02d\n"
, $tmUTC->mon() + 1, $tmUTC->mon() + 1, $tmUTC->mday(), gcd($tmUTC->mon() + 1, $tmUTC->mday()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment