use Time::Moment;
print "\n[ @{[Time::Moment->now->strftime('%Y-%m-%d %H:%M:%S.%6N')]} ]";
print "\n[ @{[Time::Moment->now->strftime('%Y-%m-%d %H:%M:%S.%6N')]} ]";
print "@{[Time::Moment->now->strftime('%Y%m%d%H%M%S%6N')]}\n";
#or
my $time = Time::Moment->new;
print $time->now->strftime('%Y%m%d%H%M%S%6N');