您在:
HEPG
>
System 子网
>
DateTimePlugin
(2009-09-02,
UnknownUser
)
(检示源码)
编辑(
E
)
增加附件(
A
)
---+!! <nop>DateTimePlugin Display date and time with formatting options, relative date parameters and localized dates This plugin is an extension of the macro [[%SYSTEMWEB%.VarGMTIME][GMTIME{"format"}]] (that only allows to show the current date date and time). %BR% !DateTimePlugin lets you show any date and time before or after 'now', and it will return any part of a date such as the month name. With !DateTimePlugin you can write: %BR% In five days will be: =%<nop>DATETIME{incdays="5"}%= and will have a always coherent phrase. %TOC% ---++ Syntax Rules Use =%<nop>DATETIME{}%= to show the current date and time in default date format (as set in [[%SCRIPTURL{configure}%][configure]]). For more options use: =%<nop>DATETIME{"format" <optional parameters>}%= ---++ Parameters | *Parameter* | *Description* | *Example* | | ="..."= or =format="..."= | Format of date string; see [[%SYSTEMWEB%.VarGMTIME][GMTIME{"format"}]] for formatting variables. Without setting the date explicitly, uses the current time and date. | =%<nop>DATETIME{"$wday"}%= | | =language="..."= | Optionally localize the output. Supported languages are: English, Portuguese, Dutch. Overrides the =LANGUAGE= preference (which is currently set to: =%LANGUAGE%=). | =%<nop>DATETIME{"$wday" language="pt"}%= | | =date="..."= | Before formatting, set the date in one of the following formats: %BR%%BR% \ Default Foswiki format %BR% \ =31 Dec 2001 - 23:59= %BR%%BR% \ Foswiki format without time (defaults to =00:00=) %BR% \ =31 Dec 2001= %BR%%BR% \ Date seperated by '/', '.' or '-', time with '.' or ':' %BR% \ Date and time separated by ' ', '.' and/or '-' %BR% \ =2001/12/31 23:59:59= %BR% \ =2001.12.31.23.59.59= %BR% \ =2001/12/31 23:59= %BR% \ =2001.12.31.23.59= %BR% \ =2001-12-31 23:59= %BR% \ =2001-12-31 - 23:59= %BR%%BR% \ ISO format %BR% \ =2001-12-31T23:59:59= %BR% \ ISO dates may have a timezone specifier, either Z or a signed difference in hh:mm format. For example: %BR% \ =2001-12-31T23:59:59+01:00= %BR% \ =2001-12-31T23:59Z= %BR% \ The local timezone will be assumed. %BR%%BR% \ Seconds since 1970 (UNIX time) %BR% \ =1218930300= %BR%%BR% \ *Note: will not handle dates before 1970!* | =%<nop>DATETIME{date="2001/12/31"}%= | | =incdays="..."= | Increase the date by any number of days (may be a negative number) | =%<nop>DATETIME{date="31 Dec 2001" incdays="1"}%= | | =inchours="..."= | Increase the date by any number of hours (may be a negative number) | =%<nop>DATETIME{date="31 Dec 2001 - 07:00" format="$hours" inchours="-1"}%= | | =incminutes="..."= | Increase the date by any number of minutes (may be a negative number) | =%<nop>DATETIME{date="31 Dec 2001" format="$minutes" incminutes="15"}%= | | =incseconds="..."= | Increase the date by any number of seconds (may be a negative number) | =%<nop>DATETIME{date="31 Dec 2001" format="$seconds" incseconds="20"}%= | | =timezoneoffset="..."= | Increase the date by any number of hours (may be a negative number). Overrides the default value in [[%SCRIPTURL{"configure"}%/#DateTimePlugin$Extensions][configure]]. | =%<nop>DATETIME{date="31 Dec 2001" format="$seconds" timezoneoffset="20"}%= | ---+++ Formatting parameters See [[%SYSTEMWEB%.VarGMTIME][GMTIME{"format"}]] for general date and time formatting parameters to pass to =format=. !DateTimePlugin supports the following additional parameters: | *Parameter* | *Description* | *Example* | | =$month_long= | The long name of the month. | =July= | | =$wday_long= | The long name of the day of the week. | =Wednesday= | ---+++ Localized formatting parameters Either set preference =LANGUAGE= to your language of choice, or use the =DATETIME= parameter =language=. | *Parameter* | *Description* | *Example* | | =$month= with =language="..."= | The localized short name of the month. | =Out= | | =$month_long= with =language="..."= | The localized long name of the month. | =Outubro= | | =$wday= with =language="..."= | The localized short name of the day of the week. | =Seg= | | =$wday_long= with =language="..."= | The localized long name of the day of the week. | =Segunda-feira= | ---+++ Deprecated formatting parameters These parameters will continue to work, but we advice to use the parameters above. | *Deprecated parameter* | *Explanation* | *Suggestion* | | =$i_month= | The localized short name of the month. | Use =$month= with a =language="..."= setting. | | =$i_lmonth= | The localized long name of the month. | Use =$month_long= with a =language="..."= setting. | | =$lmonth= | The English long name of the month. | Use =$month_long= with a =language="en"= setting. | | =$i_wday= | The localized short name of the day of the week. | Use =$wday= with a =language="..."= setting. | | =$i_lwday= | The localized long name of the day of the week. | Use =$wday_long= with a =language="..."= setting. | | =$lwday= | The English long name of the day of the week. | Use =$wday_long= with a =language="en"= setting. | | =$sec= | Undocumented notation for seconds. | Use =$seconds=. | | =$min= | Undocumented notation for minutes. | Use =$minutes=. | | =$hour= | Undocumented notation for hours. | Use =$hours=. | | =$day2= | Undocumented notation for day. | Use =$day=. | ---+++ Overview of all formatting variables %DATETIME{format=" | =$<nop>seconds= | $seconds | | =$<nop>minutes= | $minutes | | =$<nop>hours= | $hours | | =$<nop>day= | $day | | =$<nop>wday= | $wday | | =$<nop>wday_long= | $wday_long | | =$<nop>dow= | $dow | | =$<nop>week= | $week | | =$<nop>month= | $month | | =$<nop>month_long= | $month_long | | =$<nop>mo= | $mo | | =$<nop>year= | $year | | =$<nop>ye= | $ye | | =$<nop>tz= | $tz | | =$<nop>iso= | $iso | | =$<nop>rcs= | $rcs | | =$<nop>http= | $http | | =$<nop>epoch= | $epoch | " language="pt"}% ---++ Examples =Yesterday was %<nop>DATETIME{"$day $month $year" incdays="-1"}%= results in: Yesterday was %DATETIME{"$lwday, $day $month $year" incdays="-1"}% --- =One week from now is %<nop>DATETIME{"$wday, $day $month $year" incdays="7"}%= results in: One week from now is %DATETIME{"$wday, $day $month $year" incdays="7"}% --- To create time-based topics: <verbatim> %DATETIME{ "Create TODO topic for tomorrow: [[ToDo$year$mo$day]] ($lwday, $day $lmonth)" incdays="1" }% </verbatim> results in: %DATETIME{ "Create TODO topic for tomorrow: <nop>ToDo$year$mo$day ($lwday, $day $lmonth)" incdays="1" }% ---++ Limitations Due to date handling in Perl, !DateTimePlugin cannot reliably handle dates earlier than 1970. #PluginSettings ---++ Plugin Settings ---+++ Localization Localized dates are read from [[%SCRIPTURL{"configure"}%/#DateTimePlugin$Extensions][configure]] - see settings with ={DateTimePlugin}=. ---+++ Debugging Visit [[%SCRIPTURL{configure}%][configure]] and set ={DateTimePlugin}{Debug}= to 1. ---++ Plugin Installation Instructions You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install". If you have any problems, or if the extension isn't available in =configure=, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help. ---++ Plugin Info | Plugin Author: | TWiki:Main.AurelioAHeckert (2004), Foswiki:Main.ArthurClemens (2008, 2009) | | Version: | 4740 | | Release: | 1.2 | | Change History: | <!-- versions below in reverse order --> | | 31 Aug 2009 | 1.2 Arthur Clemens %BR% \ New features: \ %BB% Added format parameter =$epoch= to pass seconds since 1970 (UNIX time). \ %BB% Added parameter =language=. \ %BB% Added parameter =timezoneoffset=. \ %BB% Changed the 'localized' formatting parameters; now use =language="..."= to localize output. \ %BB% Made configuration of localized strings in configure more coherent. \ %BB% Completed unit test coverage. \ %BR% \ Bug fixes: \ %BB% Fixed 'bug' in timezone offset that intentionally only uses the configure setting ={TimezoneOffset}= with current dates. To use a timezone offset with a set date, add parameter =timezoneoffset=. | | 11 Mar 2009 | 1.1 Foswiki release | | 28 Feb 2008 | 1.0 Arthur Clemens: Major rewrite to make this plugin compatible with (and use from) =TWiki::Time=. Localized language strings are now read from configure. | | 27 Jul 2004 | 0.90 Aurelio A Heckert: First release | | CPAN Dependencies: | none | | Other Dependencies: | none | | Perl Version: | 5.005 | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | | Support: | http://foswiki.org/Support/%TOPIC% |
编辑(
E
)
|
增加附件(
A
)
|
列印(
P
)
|
历史(
H
)
: r1
|
反向连结(
B
)
|
浏览(
V
)
|
W
ysiwyg edit
|
更多主题功能(
M
)
主题版本: r1 - 2009-09-02,
UnknownUser
System
登录
工具箱
用户
群组
索引
搜寻
更新
通知
订阅 RSS
统计
设定
用户手册
BeginnersStartHere
TextFormattingRules
Macros
FormattedSearch
QuerySearch
DocumentGraphics
SkinBrowser
InstalledPlugins
管理员维护
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
SiteTools
DefaultPreferences
WebPreferences
类别
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
子网
Main
Sandbox
System
Български
_jméno_jazyka
Dansk
Deutsch
English
Español
Suomi
Français
Italiano
日本語
한글
Nederlands
Norsk
Polski
Português
Português brasileiro
Русский
Svenska
简体中文
正體中文
版权所有 © 所有作者。本合作平台的所有资料归内容提贡者所有。
请
回馈
有关 HEPG 的建议、需求及问题。