use Time::Piece; print localtime->strftime('%Y%m%d.%H%M%S'); print localtime->strftime('%Y%m%d%H%M%S');