in reply to Timestamp Format Help!

use POSIX qw(strftime); print strftime '%Y-%m-%d %H:%M:%S.000', localtime;

Your error seems to be that you don't know what sprintf does, and not telling us what you get instead.