1

How to stat the time a file was modified ins specific datetime format

view story
linux-howto

http://stackoverflow.com – I need to write to a file and then get the last_modified date and update a table. How would I do the following: echo 'new file' > /tmp/file.txt stat /tmp/file.txt 16777218 16641883 -rw-r--r-- 1 david wheel 0 6 "Feb 19 16:48:21 2013" "Feb 19 16:48:21 2013" "Feb 19 16:48:21 2013" "Feb 19 16:48:21 2013" 4096 8 0 hello.txt How would I get the last_modified time in the format of "YYYY-MM-DD HH:MM:SS" to do the following SQL update? update title set datetime='2012-01-01 00:00:01' where id=2 (HowTos)