perl -le '@_=localtime; print sprintf("%4d-%02d-%02d %02d:%02d:%02d", $_[5]+1900, $_[4]+1, @_[3,2,1,0])' 2006-07-18 15:57:36