Skip to content

Instantly share code, notes, and snippets.

@marcioferreira
Last active December 28, 2015 11:09
Show Gist options
  • Save marcioferreira/7491754 to your computer and use it in GitHub Desktop.
Save marcioferreira/7491754 to your computer and use it in GitHub Desktop.
perl -MDateTime -E'
my %cvd = map { $b = 9+ord$_; $b>100 ? $b-70 : $b-64 => $_ } "A".."Z", "a".."z";
say f_dt( DateTime->now->set_time_zone("America/Sao_Paulo"));
sub f_dt{
my ($dt) = shift;
$dt =~ s/[:T\-]|^.{4}|.{2}$//go;
return join "", map { $cvd{$_} // $_+0 } unpack("A2 A2 A2 A2", $dt)
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment