潜望镜时间戳 [英] Periscope timestamps

查看:306
本文介绍了潜望镜时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行以下请求:POST https://signer.periscope.tv/sign HTTP在/1.1应用程式潜望镜它生成3时间戳。

When I perform the following request: POST https://signer.periscope.tv/sign HTTP/1.1 in Periscope app it generates 3 timestamps.

下面是那些时间戳的3个例子,但我想不出他们的意思。

Below are 3 examples of those timestamps, but I can't figure out what they mean.

我知道,3号永远是Linux的时间戳,但什么是1安培; 2,他们如何与Linux的时间戳?

I know that number 3 is always the Linux timestamp, but what are 1 & 2 and how are they related to the Linux timestamp?

什么是tpForBroadcasterFrame和时间戳是如何关联的?

What is "tpForBroadcasterFrame" and how is related to timestamp?


  • 1 ntpForBroadcasterFrame:15704244410975025152

  • 2 ntpForLiveFrame:15704244125303865344

  • 3时间戳:1447440545

  • 1 ntpForBroadcasterFrame: 15704244410975025152
  • 2 ntpForLiveFrame : 15704244125303865344
  • 3 timestamp : 1447440545

3时间戳:1447440553

3 timestamp : 1447440553

推荐答案

前两个看起来是网络时间协议的时间戳。第三个是更正确地称为POSIX时间戳。

The first two look to be Network Time Protocol time stamps. The third one is more correctly called a POSIX timestamp.

在一个无符号的64位整数,再presents自1900年以来的秒32位,小数秒32位NTP存储数据,所以......

NTP stores data in an unsigned 64 bit integer that represents 32 bits of seconds since 1900 and 32 bits of fractional seconds, so...

屏蔽关的15704244410975025152前32位给出了3656429334秒自1900年以来其他32位都没有映射到POSIX时间戳作为它的最小分辨率为1秒。

Masking off the first 32 bits of 15704244410975025152 gives 3656429334 seconds since 1900. The other 32 bits have no mapping to a POSIX timestamp as its minimum resolution is 1 second.

减去2208988800,<一个href=\"http://stackoverflow.com/questions/8805832/number-of-seconds-from-1st-january-1900-to-start-of-unix-epoch\">the 1900年到1970年之间的秒数,从3656429334给人1447440534秒因为POSIX的时代,或星期五,2015年11月13日18时48分54秒GMT

Subtracting 2208988800, the number of seconds between 1900 and 1970, from 3656429334 gives 1447440534 seconds since the Posix epoch, or Fri, 13 Nov 2015 18:48:54 GMT

快速劈code:

#include <iostream>

constexpr uint64_t epochdelta = 2208988800L; // number of seconds between 1900 and 1970

int main()
{
    uint64_t num= 15704244410975025152ULL;

    uint32_t seconds  = (uint32_t)(num >> 32);


    std::cout << seconds << " seconds since 1900"  << std::endl;
    std::cout << seconds - epochdelta << " seconds since 1970" << std::endl;
    return 0;
}

这篇关于潜望镜时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆