Last modified: 2006-08-27 20:22:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9116, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7116 - Create {{#time:}} for date() or Language::sprintfDate()
Create {{#time:}} for date() or Language::sprintfDate()
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 3453 5733 6693 7115 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-24 13:53 UTC by Aryeh Gregor (not reading bugmail, please e-mail directly)
Modified: 2006-08-27 20:22 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 13:53:52 UTC
Bug 7114 comment #4, by Tim Starling:
> I have a better idea: a parser function called #time. It takes one required 
> parameter and one optional parameter. The required parameter is a date format in 
> the style of Language::sprintfDate(), which is the internationalised date 
> formatter I wrote a few weeks ago. The optional parameter is a string date as 
> accepted by strtotime(), the same function we use for block expiries. strtotime() 
> accepts both relative and absolute dates, so it could do timezone conversions. 
> 
> For example, you could find out what time it is here in Melbourne with:
> 
> {{#time:H:i|+10 hours}}
> 
> This is very simple to code, just a few lines.

Bug 7114 comment #6, by me:
> If you do this, how about adding U to the list of supported formatting
> characters?  That would mean date arithmetic would be possible via {{#time:
> Y-m-d H:i:s|@{{#expr: {{#time:U|2007-09-25 15:51:01}} - {{#time:U|2006-08-24
> 14:50:00}} }} }}, which is hardly elegant and not particularly efficient but
> should be usable.  (Why not support all PHP's formatting characters anyway? 
> It's not as though cases after the one you hit are going to affect performance,
> I assume.)

Split into a new bug, and I'll dupe all the "{{CURRENTx}}" requests pending to this.
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 13:58:51 UTC
*** Bug 5733 has been marked as a duplicate of this bug. ***
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 13:59:28 UTC
*** Bug 5755 has been marked as a duplicate of this bug. ***
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 14:01:57 UTC
Oh, right, some explanation for non-programmers.  Basically this would allow you
access to either PHP's date() function or else a more internationalized
MediaWiki-specific equivalent.  See
<http://www.php.net/manual/en/function.date.php> for a general idea of how this
will work: give it a date, get back the same date formatted however you specify.
 For how date entry will work, see
<http://www.php.net/manual/en/function.strtotime.php>; basically any unambiguous
date format will be accepted.
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 14:04:31 UTC
*** Bug 6693 has been marked as a duplicate of this bug. ***
Comment 5 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 14:09:00 UTC
*** Bug 7115 has been marked as a duplicate of this bug. ***
Comment 6 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 14:16:51 UTC
*** Bug 3453 has been marked as a duplicate of this bug. ***
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-27 20:22:51 UTC
Added in r16219.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links