printf vs sprintf - perl

I would like to assign the output of printf to a variable in perl , it give me back a "1" instead of the time. How can I stuff the variable with what printf returns?

Here is my code:

#!/usr/bin/perl

$time = localtime(time);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);

$newtime = printf ("%4d-%02d-%02d %02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec);

print "$newtime\n";

Any suggestions?

Thanks in advance.

Try

$ cat ./mycode
#!/usr/bin/perl

$time = localtime(time);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);

$newtime = sprintf ("%4d-%02d-%02d %02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec);

print "$newtime\n";

$ ./mycode
2009-04-02 16:55:311

You can't, you need to to use sprintf.

Thanks Guys!!