Quellcode durchsuchen

Update iso8601 to output non : separated times

master
Mitch Tishmack vor 10 Jahren
Ursprung
Commit
bce916fbcd
1 geänderte Dateien mit 11 neuen und 4 gelöschten Zeilen
  1. +11
    -4
      bin.org

+ 11
- 4
bin.org Datei anzeigen

@@ -655,12 +655,19 @@ generally without depending on gnu date.
use strict;
use warnings;
use POSIX qw(strftime);
use Getopt::Long;

my $short = 0;
GetOptions('short' => \$short,
's' => \$short
);

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;
#+END_SRC



Laden…
Abbrechen
Speichern