首页 WordPress函数大全 date_i18n()

date_i18n()

2020-05-01 / 2215阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

date_i18n( string $format, int|bool $timestamp_with_offset = false, bool $gmt = false )

Retrieves the date in localized format, based>

Contents

  • Description
    • Parameters
    • Return
    • Source
    • Changelog
  • Related
    • Uses
    • Used By
  • User Contributed Notes

描述

If the locale specifies the locale month and weekday, then the locale will take over the format for the date. If it isn’t, then the date format string will be used instead.

Note that due to the way WP typically generates a sum of timestamp and offset with strtotime(), it implies offset added at a current time, not at the time the timestamp represents. Storing such timestamps or calculating them differently will lead to invalid output.

参数

$format

(string)
(Required)
Format to display the date.

$timestamp_with_offset

(int|bool)
(Optional)
A sum of Unix timestamp and timezone offset in seconds.

Default value: false

$gmt

(bool)
(Optional)
Whether to use GMT timezone.>Default value: false

返回

(string) The date, translated if locale specifies it.

大家谈论
    我的见解