So I am using  TIMESTAMP=$( stat -c %y $JARNAME.jar ) print $TIMESTAMPand its output is something like 2015-04-24 17:23:03.000000000 -0500I need only the 2015-04-24 17:23:03 part
How to cut a date/timestamp String?
bash;cut;stat
Since you seem to be using the Linux version of stat(1), I'll assume you also have the GNU coreutils version of date(1):TIMESTAMP=$( date +'%Y-%m-%d %H:%M:%S' -r $JARNAME.jar )