$datetime = $year.'-'.$mon.'-'.$mday.' '.$hour.':'.$min.':'.$sec.'.000'; #### #!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw(-oldstyle_urls :standard); use Date::Calc qw( Today Today_and_Now Date_to_Days Add_Delta_Days ); my $date = sprintf("%04d-%02d-%02d", (Date::Calc:Today())); # this one does not work my $date2 = sprintf "%02d-%02d-%04d", (Date::Calc:Today())[1,2,0]; # it does not work as well my $date3 = sprintf "%04d-%02d-%02d",Today(); # this works, but I cant get on the format I want. print $date; print $date2; print $date3; # this is the format I am trying to get using Date::Calc #$year.'-'.$mon.'-'.$mday.' '.$hour.':'.$min.':'.$sec.'.000';