#!/usr/bin/perl use strict; use warnings; use Time::localtime; use DateTime; printf "%02d-%02d-%04d\n", localtime->mday, localtime->mon + 1, localtime->year + 1900; print DateTime->today->dmy('-'), "\n"; print DateTime->new(day => 31, month => 12, year => 2007)->dmy('-'), "\n";