Search code examples
timewebsockettime-format

What is this time format? (10 digits, 5 decimals)


So a website that I'm using has a websocket and they provide the broadcast time in the following manner:

"broadcasted_at":1574325570.71308

What is this time format and how do they generate it?


Solution

  • Unix epoch time ... the number of seconds that have elapsed since the Unix epoch, that is the time 00:00:00 UTC on 1 January 1970

    now            :      1574327074 : Thu Nov 21 03:04:34 2019
    start of day   :      1574316000 : Thu Nov 21 00:00:00 2019
    1574325570     :      1574325570 : Thu Nov 21 02:39:30 2019
    

    convert online : https://www.epochconverter.com/

    ... or download code (to build) to have command line program to perform the conversion https://github.com/darrenjs/c_dev_utils

    I'm guessing the fractional part is the number of microseconds within the current second.