EZLocaleDate

Summary: make displaying the date and/or time with a non-English language inside the wiki easy
Version: 1.4
Prerequisites: none
Status: obsolete Working if you want to use this fix, the deprecated 'strftime' function yourself
Maintainer: gnuzoo
Discussion: EZLocaleDate-Talk
Categories: Markup

Note, the PmWiki core has an equivalent Markup Expression "ftime" which can be used instead of this recipe like this:

* Time: {(ftime %X)}
* Date: {(ftime %x)}
* Local: {(ftime %L)}
  • Time: 06:53:20 AM
  • Date: 04/30/2026
  • Local:

The core function allows additionally to set a specific time stamp, and to display it in a format %L adapted for individual international visitors (rather than based on the server locale).


v 1.4 still uses PHP deprecated function strftime --gnuzoo

Questions answered by this recipe

  • How do I display the date or time with a non-English language in a wiki page using wiki code?
  • How do I display the date or time with a non-English language in a specific format in a wiki page?

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.

Description

Display date or time with a non-English language in a wiki page.

This is easier than using MoreCustomPageVariables.

Syntax is easy. Use the form of page code like this:

(:ezlocaledate formatting string:)
(:ezlocaletime formatting string:)

Default formatting code:

Todays date is(:ezlocaledate:). The current time is (:ezlocaletime:).

will display like this:

Todays date is April 2, 2007. The current time is 5:04:56.

Formatted code:

(:ezlocaledate "M j, Y h:i:s a":)

will display like this:

Mar 30, 2007 11:55:01 pm

Note: ezlocaledate can display time and ezlocaletime can display the date!

Date formatting information is available at url

Installing

Copy EZLocaleDate.phpΔ to your cookbook directory

In your config.php enter:

include_once("cookbook/EZLocaleDate.php");

or in your farmconfig.php enter:

include_once("$FarmD/cookbook/EZLocaleDate.php");

Notes

Release Notes

  • Version: 1.2 - Initial Release

See Also

Contributors

Comments

See discussion at EZLocaleDate-Talk

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2fEZLocaleDate
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2fEZLocaleDate
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/EZLocaleDate
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook/EZLocaleDate
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afL8YId8bWkXLsp5kvs9KwAAAFg
            [REDIRECT_URL] => /wiki/Cookbook/EZLocaleDate
            [REMOTE_ADDR] => 216.73.216.25
            [REMOTE_PORT] => 50753
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook/EZLocaleDate
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/EZLocaleDate
            [SCRIPT_URL] => /wiki/Cookbook/EZLocaleDate
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afL8YId8bWkXLsp5kvs9KwAAAFg
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777532000.3754
            [REQUEST_TIME] => 1777532000
            [argv] => Array
                (
                    [0] => n=Cookbook%2fEZLocaleDate
                )

            [argc] => 1
        )

)