| @@ -655,12 +655,19 @@ generally without depending on gnu date. | |||||
| use strict; | use strict; | ||||
| use warnings; | use warnings; | ||||
| use POSIX qw(strftime); | use POSIX qw(strftime); | ||||
| use Getopt::Long; | |||||
| my $short = 0; | |||||
| GetOptions('short' => \$short, | |||||
| 's' => \$short | |||||
| ); | |||||
| my $now = time; | my $now = time; | ||||
| my $tz = strftime(('%z', (localtime $now))); | |||||
| $tz =~ s/(\d{2})(\d{2})/$1:$2/smx; | |||||
| my $time = strftime('%Y-%m-%dT%H:%M:%S', (localtime $now)); | |||||
| print "$time$tz\n"; | |||||
| if ($short) { | |||||
| print strftime('%Y%m%dT%H%M%SZ', (gmtime $now)) . "\n"; | |||||
| } else { | |||||
| print strftime('%Y-%m-%dT%H:%M:%SZ', (gmtime $now)) . "\n"; | |||||
| } | |||||
| exit 0; | exit 0; | ||||
| #+END_SRC | #+END_SRC | ||||