# 跨午夜的视频号作品怎样按北京时间归入日报？

[规范网址](https://social2api.com/guides/wechat-channels-beijing-date-boundary/)

API 用北京时间确定今天，起止日按 YYYY-MM-DD 填写且包含当日。按明确日期重查可避免两地对相对时间的理解不同。

## Agent 提示词

~~~~text
请在 Social2api 使用微信视频号作品与评论，执行以下任务。
目标：用 UTC+08:00 对齐请求日期参数。
输入与对照示例：海外团队周日晚发起查询时，北京已是周一。团队固定用北京周一至周日做周报，并在文件注明汇报日界线。
公开查询可先用免密钥合成示例；实时取数需要权限和部署支持。
按以下步骤完成：先约定按北京时间的报告区间并换算起止日。 在视频号任务明确填写 since 和 until，检查结束日未晚于北京时间今天。 用导出的 publishedAt 抽查边界作品，发现来源时间粒度不够时另记。 按作品时间归档前，保留原时间戳和 videoId。用量归账有独立的 UTC 日期，另列保存。
交付能核对的结果和必要字段：params.since、params.until、publishedAt、warnings。注明来源或限制，并以本页为操作参考。
https://social2api.com/guides/wechat-channels-beijing-date-boundary/
~~~~

[按明确起止日试跑](https://social2api.com/#workspace/channels)

[查看对应 API](https://social2api.com/docs/api/wechat-channels-videos/)

## 本页用到的 Social2api 接口

| 接口与参数文档 | 用途 |
| --- | --- |
| [微信视频号作品与评论](https://social2api.com/docs/api/wechat-channels-videos/) · POST /api/run · task=channels | 解析微信视频号账号，取回其公开视频以及每个视频的部分评论。 |

## 在 Social2api 使用微信视频号作品与评论

1. 先约定按北京时间的报告区间并换算起止日。
2. 在视频号任务明确填写 since 和 until，检查结束日未晚于北京时间今天。
3. 用导出的 publishedAt 抽查边界作品，发现来源时间粒度不够时另记。
4. 按作品时间归档前，保留原时间戳和 videoId。用量归账有独立的 UTC 日期，另列保存。

## 复制请求并试跑

用固定的北京时间周一至周日查看作品日期列，并在地理时区不同的团队之间使用相同窗口。

这条请求使用合成样例，免登录、免 API Key，上游请求数为 0。要查真实数据，将 mode 改为 live，换成实际输入，并在 Authorization 中提供有相应任务权限的 Bearer API Key。可用 maxRequests 限制实时上游请求数。

~~~~bash
curl --fail-with-body -sS 'https://social2api.com/api/run' \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "task": "channels",
  "mode": "demo",
  "params": {
    "account": "北京时间周报示例账号",
    "limit": 3,
    "commentsPerVideo": 0,
    "since": "2026-10-12",
    "until": "2026-10-18"
  }
}
JSON
~~~~

## 用两个带时区的时间戳核对跨午夜

托管 demo 返回日粒度示例，只用来核对字段。下面用离线固定值复算北京时间 1 月 15 日的起点。真实响应若只给日期，保留原日期和数据源，不能从中复原午夜前后的具体时分秒。

~~~~python
from datetime import date, datetime
from zoneinfo import ZoneInfo

samples = ['2026-01-14T15:59:59Z', '2026-01-14T16:00:00Z', '2026-01-15', None]
report_day = date(2026, 1, 15)
china = ZoneInfo('Asia/Shanghai')

def china_date(value):
    if not value or len(value) == 10:
        return None
    timestamp = datetime.fromisoformat(value.replace('Z', '+00:00'))
    return timestamp.astimezone(china).date() if timestamp.tzinfo else None

converted = [china_date(value) for value in samples]
assert converted == [date(2026, 1, 14), report_day, None, None]
print([value for value in samples if china_date(value) == report_day])
~~~~

## 操作示例与核对

海外团队周日晚发起查询时，北京已是周一。团队固定用北京周一至周日做周报，并在文件注明汇报日界线。

## 需要核对的字段

params.since、params.until、publishedAt、warnings。

## 接口文档

- [微信视频号作品与评论](https://social2api.com/docs/api/wechat-channels-videos/)

## 相关用户讨论

- [相邻平台类比 · Reddit · Get all posts after a precise date?](https://www.reddit.com/r/redditdev/comments/lw0196/get_all_posts_after_a_precise_date/)
- [相邻平台类比 · LinkedIn · 在整理公司以往贴文清单时看见的是一个月前、两个月前，怎样得到精确发布日期？网页源码也没找到。](https://www.reddit.com/r/linkedin/comments/1qvdt7d/)

## 相关指南和问答

- [如何批量获取微信视频号历史作品和评论并导出 CSV](https://social2api.com/guides/wechat-channels-export-videos-comments/)

[按明确起止日试跑](https://social2api.com/#workspace/channels)
