in reply to Date displaying the 0's

Or have a CPAN module do all the error-prone date-handling for you. For instance DateTime
use DateTime $date = DateTime->now()->ymd();