#!/bin/perl use strict; use Time::Local; die "Wrong parameter count." unless scalar(@ARGV) == 1; die "Wrong parameter format." unless $ARGV[0] =~ /(\d{4})(\d{2})(\d{2})/; my @d = localtime(timelocal(0, 0, 0, $3, $2-1, $1) - 86400); printf("%04d%02d%02d", ($d[5]+1900), $d[4]+1, $d[3]);