summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorleifj <leifj@0878fbc5-a6f2-46f6-b174-cb7b08c221d1>2009-07-18 22:31:36 +0000
committerleifj <leifj@0878fbc5-a6f2-46f6-b174-cb7b08c221d1>2009-07-18 22:31:36 +0000
commit8e0276a0c6e0a79cf73769a6e04eec2bcb02aa12 (patch)
treee3b2b899c721dd5b6704e12c814b576ab1386eaf /scripts
parentba4ae24b25911a8e6b58dd42f249e84c134670da (diff)
small script to generate xs:datetime dates
git-svn-id: svn+ssh://svn.it.su.se/svn/swamid-metadata/trunk@161 0878fbc5-a6f2-46f6-b174-cb7b08c221d1
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/expiration_date.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/expiration_date.pl b/scripts/expiration_date.pl
new file mode 100755
index 00000000..cf297c5f
--- /dev/null
+++ b/scripts/expiration_date.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/env perl
+
+use Date::Calc qw/Today_and_Now Add_Delta_Days/;
+my $delta = $ARGV[0];
+$delta = 30 unless $delta;
+
+($year,$month,$day,$hour,$min,$sec) = Today_and_Now();
+($year,$month,$day) = Add_Delta_Days($year,$month,$day,$delta);
+my $date = sprintf "%s-%02d-%02dT%02d:%02d:%02dZ",$year,$month,$day,$hour,$min,$sec;
+print $date;
+