in reply to month off by one?

Others have pointed you to the docs, which is were you should have gone. First, you could check what DB functions may be available to you to have it create your time string. Another alternative is to use POSIX (I like it, some don't).

#!/usr/bin/perl -w use strict; use POSIX; my $date = POSIX::strftime('%Y-%m-%d', localtime);

Cheers,
KM