Plugin / Localize Time
Description
Description
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.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), specifyfmt="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.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.
Ratings
Rating breakdown
Details Information
Version
First Released
Total Downloads
Wordpress Version
Tested up to:
Require PHP Version:
Tags
Contributors
Languages
The plugin hasn't been transalated in any language other than English.
DIRECTORY DISCLAIMER
The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.
The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.
Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.
While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.
wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.