Created 06-20-2018 03:45 PM
how can I convert this start and finish time to normal date format?
$ yarn application -status application_1517871817099_0015 Application Report : Application-Id : application_1517871817099_0015 Application-Name : distcp Application-Type : MAPREDUCE Queue : default Application Priority : null Start-Time : 1517874876754 Finish-Time : 1517875501288 Progress : 100% State : KILLED Final-State : KILLED
Created 06-20-2018 04:30 PM
ok I found three ways to convert correctly the milliseconds unix time to human readable time format
mysql> select from_unixtime(floor(1517874876754/1000)); +------------------------------------------+ | from_unixtime(floor(1517874876754/1000)) | +------------------------------------------+ | 2018-02-05 18:54:36 | +------------------------------------------+ 1 row in set (0.00 sec) $ awk '{print strftime("%c", ( 1517874876754 + 500 ) / 1000 )}' Mon 05 Feb 2018 06:54:37 PM EST $ date -d @$( echo "(1517874876754+ 500) / 1000" | bc) Mon Feb 5 18:54:37 EST 2018
Created 06-20-2018 04:18 PM
I found two methods online which gives different results , which one is correct ?
$ date -d @1517874876754 Tue Jul 16 02:12:34 EDT 50069
mysql> select from_unixtime(floor(1517875501288/1000)); +------------------------------------------+ | from_unixtime(floor(1517875501288/1000)) | +------------------------------------------+ | 2018-02-05 19:05:01 | +------------------------------------------+
Created 06-20-2018 04:30 PM
ok I found three ways to convert correctly the milliseconds unix time to human readable time format
mysql> select from_unixtime(floor(1517874876754/1000)); +------------------------------------------+ | from_unixtime(floor(1517874876754/1000)) | +------------------------------------------+ | 2018-02-05 18:54:36 | +------------------------------------------+ 1 row in set (0.00 sec) $ awk '{print strftime("%c", ( 1517874876754 + 500 ) / 1000 )}' Mon 05 Feb 2018 06:54:37 PM EST $ date -d @$( echo "(1517874876754+ 500) / 1000" | bc) Mon Feb 5 18:54:37 EST 2018