Title: Localize Time
Author: JB Christy
Published: <strong>2014 年 5 月 30 日</strong>
Last modified: 2014 年 5 月 30 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/localize-time.svg)

# Localize Time

 由 [JB Christy](https://profiles.wordpress.org/jbchristy/) 開發

[下載](https://downloads.wordpress.org/plugin/localize-time.1.0.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/localize-time/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/localize-time/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/localize-time/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/localize-time/#developers)

 [技術支援](https://wordpress.org/support/plugin/localize-time/)

## 外掛說明

This WordPress plugin adds the **`[localize_time]`** shortcode. The shortcode allows
an author
 to enter a date and time in any timezone. The shortcode displays the 
original time with timezone, followed by the same time in the user’s timezone, formatted
correctly for the user’s locale. This is useful for announcing live events, e.g.
a live online streaming event, to widely dispersed audiences.

The date and time to be displayed are entered as the shortcode’s content, i.e. between
the
 **`[localize_time]`** and **`[/localize_time]`** tags. The time can be specified
in almost any format that’s recognizable as a date and time.

The shortcode takes the following options:

 * **`tz`** – the timezone the shortcode’s content is in. If this option is omitted,
   it defaults
    to the site’s timezone. Timezones are specified in any format recognized
   by [PHP’s DateTimeZone](http://www.php.net/manual/en/timezones.php).
 * **`fmt`** – a format string specifying how the original time should be displayed.
   If omitted,
    it defaults to the site’s date format followed by the site’s time
   format followed by the timezone. To output the original time exactly as entered(
   with the timezone), specify **`fmt="orig"`**. Or you can enter a format string
   using the same codes that are used on WordPress’s General Settings tab. See [full documentation on date / time format strings here](https://codex.wordpress.org/Formatting_Date_and_Time).
 * **`before_local`** – the string to precede the local time. Defaults to ‘ (‘
 * **`after_local`** – the string to follow the local time. Defaults to ‘)’

### Examples

Below are examples of using the shortcode. For these examples, the site’s timezone
is set to America/New_York (EST-5EDT) and the user is in the America/Los_Angeles(
PST-8PDT) timezone.

 * Local time is in a different year and month from original time:
    [localize_time]
   1/1/2014 1:00 am[/localize_time] outputs: January 1, 2014 1:00 am EST (12/31/
   2013, 10:00:00 PM PST)
 * Specify a time in timezone different from the site’s:
    [localize_time tz=”Europe/
   Paris” ]July 14, 2014 19:00[/localize_time] outputs: July 14, 2014 7:00 pm CEST(
   7/14/2014, 10:00:00 AM PDT)
 * Specify a format for the original time:
    [localize_time fmt=”m/d/Y g:i A T”]June
   14, 2014 6:30 AM[/localize_time] outputs: 06/14/2014 6:30 AM EDT (6/14/2014, 
   3:30:00 AM PDT)
 * Specify a time in the same timezone as the user:
    [localize_time tz=”PST”]3pm
   Nov. 1, 2014[/localize_time] outputs: November 1, 2014 3:00 pm PDT

Note that the display of the local time varies by timezone and browser.

## 螢幕擷圖

 * [[
 * Examples of entering the shortcode.
 * [[
 * What the shortcode displays in the US Pacific timezone.

## 安裝方式

 1. Upload the `localize-time` directory to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常見問題集

  Can I change the way the local time is formatted?

No. The local time is displayed by the user’s browser in a format appropriate for
her locale.
 You can not change the format.

  What if the user is in the same timezone as the original time?

If the user is in the same timezone as the original time, she will see only the 
original time;
 the local time will not be displayed, as it would be repetitious.
See the last example above.

  Can I style the times?

Yes. In your theme’s CSS target `.localize_time_orig` to style the original times

and `.localize_time_local` to style the local times.

## 使用者評論

![](https://secure.gravatar.com/avatar/465b70f34f4d6d9cac1365feb5803bce73f06f77a28bb8671378abf730566465?
s=60&d=retro&r=g)

### 󠀁[Exactly what I needed](https://wordpress.org/support/topic/exactly-what-i-needed-783/)󠁿

 [roamingchile](https://profiles.wordpress.org/roamingchile/) 2021 年 3 月 23 日

So glad to find this. I tried it out despite it not being updated. It’s working 
on WP 5.7. It does almost exactly what I need it to. My only complaint is that I
cannot format the local time. What is generated is very long and will not look neat
in a long table of events. Would be very grateful if the dev could just make sure
all is up to date and list the plugin as current. Having the local time use the 
format inputted into the shortcode would be a big bonus. Thanks, JB.

 [ 閱讀全部 3 則使用者評論 ](https://wordpress.org/support/plugin/localize-time/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Localize Time〉的開發相關工作。

參與者

 *   [ JB Christy ](https://profiles.wordpress.org/jbchristy/)

[將〈Localize Time〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/localize-time)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/localize-time/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/localize-time/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/localize-time/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/localize-time/)。

## 變更記錄

#### 1.0.0

 * Initial release

## 中繼資料

 *  版本 **1.0.0**
 *  最後更新 **12 年前**
 *  啟用安裝數 **40+**
 *  WordPress 版本需求 ** 3.0.1 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.9.40**
 *  語言
 * [English (US)](https://wordpress.org/plugins/localize-time/)
 * 標籤:
 * [local time](https://tw.wordpress.org/plugins/tags/local-time/)[time](https://tw.wordpress.org/plugins/tags/time/)
   [timezone](https://tw.wordpress.org/plugins/tags/timezone/)
 *  [進階檢視](https://tw.wordpress.org/plugins/localize-time/advanced/)

## 評分

 3.3 星，滿分為 5 星

 *  [  1 個 5 星使用者評論     ](https://wordpress.org/support/plugin/localize-time/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/localize-time/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/localize-time/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/localize-time/reviews/?filter=2)
 *  [  1 個 1 星使用者評論     ](https://wordpress.org/support/plugin/localize-time/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/localize-time/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/localize-time/reviews/)

## 參與者

 *   [ JB Christy ](https://profiles.wordpress.org/jbchristy/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/localize-time/)