< Manual:Hooks 
 
      | GetHumanTimestamp | |
|---|---|
| Available from version 1.21.0 (Gerrit change 45651) Pre-emptively override the human-readable timestamp generated by MWTimestamp::getHumanTimestamp(). Return false in this hook to use the custom output. | |
| Define function: | public static function onGetHumanTimestamp( string &$output, MWTimestamp $timestamp, MWTimestamp $relativeTo, User $user, Language $lang ) { ... }
 | 
| Attach hook: | In extension.json: {
	"Hooks": {
		"GetHumanTimestamp": "MyExtensionHooks::onGetHumanTimestamp"
	}
}
 | 
| Called from: | File(s): ../languages/Language.php Function(s): getHumanTimestamp | 
| Interface: | GetHumanTimestampHook.php | 
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:GetHumanTimestamp extensions.
Details
- &$output: string for the output timestamp
- $timestamp: MWTimestamp object of the current (user-adjusted) timestamp
- $relativeTo: MWTimestamp object of the relative (user-adjusted) timestamp
- $user: User whose preferences are being used to make timestamp
- $lang: Language that will be used to render the timestamp
    This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.