Mastodon
  • 什么是 Mastodon?
  • 使用 Mastodon
    • 注册帐户
    • 设置你的个人资料
    • 在你的账户发布内容
    • 使用网络功能
    • 处理不想看到的内容
    • 推广你和他人
    • 进行偏好设置
    • 更多设置
    • 在站点外使用 Mastodon
    • 迁移或离开账户
    • 运行你自己的站点
  • 运营 Mastodon
    • 准备你的服务器
    • 从源代码安装
    • 配置你的环境
    • 安装可选功能
      • 对象存储
      • 洋葱服务
      • 验证码
      • 单点登录
    • 配置全文搜索
    • 设置你的新实例
    • 使用管理 CLI
    • 升级到新版本
    • 备份你的服务器
    • 迁移到新机器
    • 扩大你的站点规模
    • 审核操作
    • 故障排除
      • 数据库索引损坏
    • 用户组
  • 开发 Mastodon 应用
    • API 入门指南
    • 使用公开数据
    • 获取客户端应用访问权限
    • 使用帐户登录
    • 库与实现
  • 向 Mastodon 项目做贡献
    • 技术概览
    • 设置开发环境
    • 代码结构
    • 路由
    • 漏洞赏金与责任披露
  • 遵循的标准
    • ActivityPub
    • WebFinger
    • 安全性
    • Microformats
    • OAuth
    • Bearcaps
  • REST API
    • Datetime 格式
    • 指南与最佳实践
    • OAuth 令牌
    • OAuth 作用域
    • 速率限制
  • API 方法
    • apps
      • oauth
      • emails
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • followed_tags
      • suggestions
      • tags
    • profile
    • statuses
      • media
      • polls
      • scheduled_statuses
    • timelines
      • conversations
      • lists
      • markers
      • streaming
    • grouped notifications
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
      • announcements
    • admin
      • accounts
      • canonical_email_blocks
      • dimensions
      • domain_allows
      • domain_blocks
      • email_domain_blocks
      • ip_blocks
      • measures
      • reports
      • retention
      • trends
    • proofs
    • oembed
  • API 实体
    • Account
    • AccountWarning
    • Admin::Account
    • Admin::CanonicalEmailBlock
    • Admin::Cohort
    • Admin::Dimension
    • Admin::DomainAllow
    • Admin::DomainBlock
    • Admin::EmailDomainBlock
    • Admin::Ip
    • Admin::IpBlock
    • Admin::Measure
    • Admin::Report
    • Announcement
    • Appeal
    • Application
    • Context
    • Conversation
    • CustomEmoji
    • DomainBlock
    • Error
    • ExtendedDescription
    • FamiliarFollowers
    • FeaturedTag
    • Filter
    • FilterKeyword
    • FilterResult
    • FilterStatus
    • IdentityProof
    • Instance
    • List
    • Marker
    • MediaAttachment
    • Notification
    • NotificationPolicy
    • NotificationRequest
    • Poll
    • Preferences
    • PreviewCard
    • PreviewCardAuthor
    • PrivacyPolicy
    • Reaction
    • Relationship
    • RelationshipSeveranceEvent
    • Report
    • Role
    • Rule
    • ScheduledStatus
    • Search
    • Status
    • StatusEdit
    • StatusSource
    • Suggestion
    • Tag
    • TermsOfService
    • Token
    • Translation
    • V1::Filter
    • V1::Instance
    • V1::NotificationPolicy
    • WebPushSubscription

Datetime 格式

Datetime 格式

    • Datetime
      • 互操作性
    • 日期
      • 互操作性

Datetime

“Datetime”指定某个时刻。

Datetime 的字符串表示形式使用 RFC3339 第 5.6 节 中定义的“互联网日期/时间格式”。

总的来说,它包含以下必须包含的部分:

[YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[s][TZD]

其中:

  • [YYYY] = 四位数的年份
  • [MM] = 两位数的月份(01=一月,以此类推)
  • [DD] = 两位数的月份中的日期(01 到 31)
  • [hh] = 小时的两位数字(00 到 23)(不允许 24)
  • [mm] = 分钟的两位数字(00 到 59)
  • [ss] = 秒的两位数字(00 到 60)
  • [s] = 一位或多位数字表示秒的小数部分
  • [TZD] = 时区指示符(UTC 为 Z,或者 +[hh]:[mm] 或 -[hh]:[mm] 表示与 UTC 的偏移量)

例如,1994-11-05T13:15:30.000Z(等同于 1994-11-05T08:15:30-05:00)。

有关完整的 ABNF 语法,请查看 RFC3339 第 5.6 节。

互操作性

  • 日期和时间部分始终用大写 T 分隔(不是小写,也不是空格)。
  • 时区指示符 Z 始终为大写,而不是小写。
  • 秒的小数部分([s])至少用一位数字表示,最多三位数字表示。
  • 精确度较低的字段也可以表示为 Datetime。 例如,服务器可能会将某个 Datetime 值截断至当天午夜。

日期

“日期”指定活动发生的公历日期,以 UTC 为准。

日期的字符串表示形式使用 ISO 8601(日期和时间表示的国际标准,第 5.2.1.1 节)中的完整、扩展的日历日期表示形式。 这也是 W3C 日期与时间格式中的“完整日期”格式。

包含以下必须包含的组成部分:

[YYYY]-[MM]-[DD]
  • [YYYY] = 四位数的年份
  • [MM] = 两位数的月份(01=一月,以此类推)
  • [DD] = 两位数的月份中的日期(01 到 31)

互操作性

  • 年、月和日期组件始终用 - 分隔。

翻译状态: 本文是英文页面 Datetime formats 的翻译,最后翻译时间:2025-04-21,点击这里可以查看翻译后页面的改动。

最后更新于 April 21, 2025 · 改进此页面
也可在此找到: English

赞助商

Dotcom-Monitor LoadView Stephen Tures Swayable SponsorMotion

加入Mastodon · 博客 ·

查看源代码 · CC BY-SA 4.0 · 版权信息