CakePHP
  • 文档
    • 图书
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 标识和商标
  • 商业解决方案
  • 礼品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与进来
    • 问题 (Github)
    • 面包店
    • 特色资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C Chronos 3.x API

  • 项目
    • Chronos
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 3.x
      • 3.x
      • 2.x
      • 1.x

命名空间

  • Cake\Chronos

Trait FormattingTrait

为日期时间实例提供字符串格式化方法。

期望实现类定义 static::$toStringFormat

命名空间: Cake\Chronos

方法摘要

  • __toString() public

    返回由 setToStringFormat() 指定的格式化字符串或默认 DEFAULT_TO_STRING_FORMAT 格式。

  • resetToStringFormat() public static

    将 __toString() 格式重置为 DEFAULT_TO_STRING_FORMAT。

  • setToStringFormat() public static

    设置 __toString() 格式。

  • toAtomString() public

    将实例格式化为 ATOM

  • toCookieString() public

    将实例格式化为 COOKIE

  • toDateString() public

    将实例格式化为日期

  • toDateTimeString() public

    将实例格式化为日期和时间

  • toDayDateTimeString() public

    用日期、日期和时间格式化实例

  • toFormattedDateString() public

    将实例格式化为可读日期

  • toIso8601String() public

    将实例格式化为 ISO8601

  • toQuarter() public

    返回季度

  • toRfc1036String() public

    将实例格式化为 RFC1036

  • toRfc1123String() public

    将实例格式化为 RFC1123

  • toRfc2822String() public

    将实例格式化为 RFC2822

  • toRfc3339String() public

    将实例格式化为 RFC3339

  • toRfc822String() public

    将实例格式化为 RFC822

  • toRfc850String() public

    将实例格式化为 RFC850

  • toRssString() public

    将实例格式化为 RSS

  • toTimeString() public

    将实例格式化为时间

  • toUnixString() public

    返回 UNIX 时间戳。

  • toW3cString() public

    将实例格式化为 W3C

  • toWeek() public

    返回 ISO 8601 年份的周数,周从周一算起

方法详情

__toString() ¶ public

__toString(): string

返回由 setToStringFormat() 指定的格式化字符串或默认 DEFAULT_TO_STRING_FORMAT 格式。

返回
string

resetToStringFormat() ¶ public static

resetToStringFormat(): void

将 __toString() 格式重置为 DEFAULT_TO_STRING_FORMAT。

返回
void

setToStringFormat() ¶ public static

setToStringFormat(string $format): void

设置 __toString() 格式。

参数
string $format

有关接受的说明符,请参阅 format()。

返回
void

toAtomString() ¶ public

toAtomString(): string

将实例格式化为 ATOM

返回
string

toCookieString() ¶ public

toCookieString(): string

将实例格式化为 COOKIE

返回
string

toDateString() ¶ public

toDateString(): string

将实例格式化为日期

返回
string

toDateTimeString() ¶ public

toDateTimeString(): string

将实例格式化为日期和时间

返回
string

toDayDateTimeString() ¶ public

toDayDateTimeString(): string

用日期、日期和时间格式化实例

返回
string

toFormattedDateString() ¶ public

toFormattedDateString(): string

将实例格式化为可读日期

返回
string

toIso8601String() ¶ public

toIso8601String(): string

将实例格式化为 ISO8601

返回
string

toQuarter() ¶ public

toQuarter(bool $range = false): array|int

返回季度

参数
bool $range optional

范围。

返回
array|int

toRfc1036String() ¶ public

toRfc1036String(): string

将实例格式化为 RFC1036

返回
string
链接
https://tools.ietf.org/html/rfc1036

toRfc1123String() ¶ public

toRfc1123String(): string

将实例格式化为 RFC1123

返回
string
链接
https://tools.ietf.org/html/rfc1123

toRfc2822String() ¶ public

toRfc2822String(): string

将实例格式化为 RFC2822

返回
string
链接
https://tools.ietf.org/html/rfc2822

toRfc3339String() ¶ public

toRfc3339String(): string

将实例格式化为 RFC3339

返回
string
链接
https://tools.ietf.org/html/rfc3339

toRfc822String() ¶ public

toRfc822String(): string

将实例格式化为 RFC822

返回
string
链接
https://tools.ietf.org/html/rfc822

toRfc850String() ¶ public

toRfc850String(): string

将实例格式化为 RFC850

返回
string
链接
https://tools.ietf.org/html/rfc850

toRssString() ¶ public

toRssString(): string

将实例格式化为 RSS

返回
string

toTimeString() ¶ public

toTimeString(): string

将实例格式化为时间

返回
string

toUnixString() ¶ public

toUnixString(): string

返回 UNIX 时间戳。

返回
string

toW3cString() ¶ public

toW3cString(): string

将实例格式化为 W3C

返回
string

toWeek() ¶ public

toWeek(): int

返回 ISO 8601 年份的周数,周从周一算起

返回
int
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 图书
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 标识和商标
  • 社区
  • 参与进来
  • 问题 (Github)
  • 面包店
  • 特色资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成