my @d = ( localtime )[5,4,3,2,1,0]; $d[0]-=100; # fix the year printf("%02.d-%02.d-%02.d_%02.d:%02.d:%02.d", @d); #### 04-11-29_11:29:37