FQL和营业时间

发布于 2024-10-19 01:23:13 字数 3342 浏览 6 评论 0原文

我正在使用 FQL 从一家小型企业的 Facebook 页面查询信息,并尝试解析营业时间。我返回的数字似乎代表秒,但我不确定纪元是什么时候。星期三和星期四是最令人困惑的 - 星期四的开盘时间是“57600”,这将是 16 小时(以秒为单位),这将使星期三下午 4 点成为纪元,但星期三的收盘时间(远远超过 4 点)在 600,000 多个范围内。

周一:上午 8:15 至中午 12 点和下午 1 点至下午 5 点周二:上午 8 点至中午 12 点和下午 1 点至下午 5 点周三:上午 8 点至中午 12 点和下午 1 点至晚上 9 点周四:上午 8 点至中午 12 点和下午 1 点至下午 5 点周五:上午 8 点至中午 12 点和下午 1 点至下午 5 点周六:上午 8 点-12pm 和 1pm - 5pm

<hours>
      <mon_1_open>404100</mon_1_open>
      <mon_1_close>417600</mon_1_close>
      <tue_1_open>489600</tue_1_open>
      <tue_1_close>504000</tue_1_close>
      <wed_1_open>576000</wed_1_open>
      <wed_1_close>590400</wed_1_close>
      <thu_1_open>57600</thu_1_open>
      <thu_1_close>72000</thu_1_close>
      <fri_1_open>144000</fri_1_open>
      <fri_1_close>158400</fri_1_close>
      <sat_1_open>230400</sat_1_open>
      <sat_1_close>244800</sat_1_close>
      <sun_1_open>0</sun_1_open>
      <sun_1_close>0</sun_1_close>
      <mon_2_open>421200</mon_2_open>
      <mon_2_close>435600</mon_2_close>
      <tue_2_open>507600</tue_2_open>
      <tue_2_close>522000</tue_2_close>
      <wed_2_open>594000</wed_2_open>
      <wed_2_close>622800</wed_2_close>
      <thu_2_open>75600</thu_2_open>
      <thu_2_close>90000</thu_2_close>
      <fri_2_open>162000</fri_2_open>
      <fri_2_close>176400</fri_2_close>
      <sat_2_open>248400</sat_2_open>
      <sat_2_close>262800</sat_2_close>
      <sun_2_open>0</sun_2_open>
      <sun_2_close>0</sun_2_close>
    </hours>

如果我将其更改为周一至周六上午 8 点至下午 5 点,我会从 FB 得到同样令人困惑的回复,

<hours>
      <mon_1_open>403200</mon_1_open>
      <mon_1_close>435600</mon_1_close>
      <tue_1_open>489600</tue_1_open>
      <tue_1_close>522000</tue_1_close>
      <wed_1_open>576000</wed_1_open>
      <wed_1_close>608400</wed_1_close>
      <thu_1_open>57600</thu_1_open>
      <thu_1_close>90000</thu_1_close>
      <fri_1_open>144000</fri_1_open>
      <fri_1_close>176400</fri_1_close>
      <sat_1_open>230400</sat_1_open>
      <sat_1_close>262800</sat_1_close>
      <sun_1_open>0</sun_1_open>
      <sun_1_close>0</sun_1_close>
      <mon_2_open>0</mon_2_open>
      <mon_2_close>0</mon_2_close>
      <tue_2_open>0</tue_2_open>
      <tue_2_close>0</tue_2_close>
      <wed_2_open>0</wed_2_open>
      <wed_2_close>0</wed_2_close>
      <thu_2_open>0</thu_2_open>
      <thu_2_close>0</thu_2_close>
      <fri_2_open>0</fri_2_open>
      <fri_2_close>0</fri_2_close>
      <sat_2_open>0</sat_2_open>
      <sat_2_close>0</sat_2_close>
      <sun_2_open>0</sun_2_open>
      <sun_2_close>0</sun_2_close>
    </hours>

我是否错过了一些事实上的标准时间表示?有人会如何将此解析为一天中的合法时间?

I'm querying information from a Facebook page for a small business using FQL and I'm trying to parse the business hours. The numbers I am getting back seem to represent seconds but I'm not sure when the epoch is. Wednesday and Thursday are the most confusing - open on Thursday is "57600" which would be 16 hours in seconds which would make 4pm Wednesday the epoch, but the closing hours on Wednesday - far past 4- are in the 600,000+ range.

Mon: 8:15am-12pm and 1pm - 5pm Tue: 8am-12pm and 1pm - 5pm Wed: 8am-12pm and 1pm - 9pm Thur:8am-12pm and 1pm - 5pm Fri:8am-12pm and 1pm - 5pm Sat:8am-12pm and 1pm - 5pm

<hours>
      <mon_1_open>404100</mon_1_open>
      <mon_1_close>417600</mon_1_close>
      <tue_1_open>489600</tue_1_open>
      <tue_1_close>504000</tue_1_close>
      <wed_1_open>576000</wed_1_open>
      <wed_1_close>590400</wed_1_close>
      <thu_1_open>57600</thu_1_open>
      <thu_1_close>72000</thu_1_close>
      <fri_1_open>144000</fri_1_open>
      <fri_1_close>158400</fri_1_close>
      <sat_1_open>230400</sat_1_open>
      <sat_1_close>244800</sat_1_close>
      <sun_1_open>0</sun_1_open>
      <sun_1_close>0</sun_1_close>
      <mon_2_open>421200</mon_2_open>
      <mon_2_close>435600</mon_2_close>
      <tue_2_open>507600</tue_2_open>
      <tue_2_close>522000</tue_2_close>
      <wed_2_open>594000</wed_2_open>
      <wed_2_close>622800</wed_2_close>
      <thu_2_open>75600</thu_2_open>
      <thu_2_close>90000</thu_2_close>
      <fri_2_open>162000</fri_2_open>
      <fri_2_close>176400</fri_2_close>
      <sat_2_open>248400</sat_2_open>
      <sat_2_close>262800</sat_2_close>
      <sun_2_open>0</sun_2_open>
      <sun_2_close>0</sun_2_close>
    </hours>

If I change it to simply 8am-5pm Monday to Saturday I get an equally confusing response from FB

<hours>
      <mon_1_open>403200</mon_1_open>
      <mon_1_close>435600</mon_1_close>
      <tue_1_open>489600</tue_1_open>
      <tue_1_close>522000</tue_1_close>
      <wed_1_open>576000</wed_1_open>
      <wed_1_close>608400</wed_1_close>
      <thu_1_open>57600</thu_1_open>
      <thu_1_close>90000</thu_1_close>
      <fri_1_open>144000</fri_1_open>
      <fri_1_close>176400</fri_1_close>
      <sat_1_open>230400</sat_1_open>
      <sat_1_close>262800</sat_1_close>
      <sun_1_open>0</sun_1_open>
      <sun_1_close>0</sun_1_close>
      <mon_2_open>0</mon_2_open>
      <mon_2_close>0</mon_2_close>
      <tue_2_open>0</tue_2_open>
      <tue_2_close>0</tue_2_close>
      <wed_2_open>0</wed_2_open>
      <wed_2_close>0</wed_2_close>
      <thu_2_open>0</thu_2_open>
      <thu_2_close>0</thu_2_close>
      <fri_2_open>0</fri_2_open>
      <fri_2_close>0</fri_2_close>
      <sat_2_open>0</sat_2_open>
      <sat_2_close>0</sat_2_close>
      <sun_2_open>0</sun_2_open>
      <sun_2_close>0</sun_2_close>
    </hours>

Am I missing some defacto standard time representation? How would someone go about parsing this as a legitimate time of day?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演多会厌 2024-10-26 01:23:13

Unix 纪元是 1970 年 1 月 1 日 00:00:00 UTC 时间。每当您看到与基于计算机的时间相关的术语“纪元”时,通常就是这个意思。

在 UTC 中,4041001970 年 1 月 5 日星期一 16:15:00 GMT。或者,在 PST 时区中,Mon, 05 Jan 1970 08:15:00 PST 就是您期望的时间。忽略日期;无论如何,这无关紧要。

您可以使用这个 Epoch Converter 来测试我所描述的内容。

The Unix epoch is the time 00:00:00 UTC on 1 January 1970. Any time you see the term "epoch" used in relation to computer-based time, that's usually what it means.

In UTC, 404100 is Mon, 05 Jan 1970 16:15:00 GMT. Or, in the PST timezone, Mon, 05 Jan 1970 08:15:00 PST, which is the time you're expecting. Ignore the date; it's irrelevant, anyways.

You can test what I'm describing using this Epoch Converter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文