Last active
May 6, 2019 15:44
-
-
Save mdkn/174728a609b5ddacb2b6fafc5a392d03 to your computer and use it in GitHub Desktop.
perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Date::Simple qw/ymd/; | |
# http://perldoc.jp/docs/modules/Date-Simple-2.03/Simple.pod | |
#my $data = Date::Simple->new(); | |
my $dstr = "2017/03/01"; | |
my @darray = split /\//, $dstr; | |
my $year = $darray[0]; | |
if ( length($year) == 2) { | |
$year = "20" . $year; | |
} | |
my $data = ymd($year, $darray[1], $darray[2]); | |
print $data->format('%Y/%m/%d') . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment