Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312167

Change subject: time: Implement ConvertableTimestamp::now()
......................................................................

time: Implement ConvertableTimestamp::now()

Shortcut for ConvertableTimestamp::convert() for the current time.

Change-Id: I1c34c0a59bb57652c7a2e959836c8ba400a25f49
---
M includes/libs/time/ConvertableTimestamp.php
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/67/312167/1

diff --git a/includes/libs/time/ConvertableTimestamp.php 
b/includes/libs/time/ConvertableTimestamp.php
index a4c79ba..a784dc6 100644
--- a/includes/libs/time/ConvertableTimestamp.php
+++ b/includes/libs/time/ConvertableTimestamp.php
@@ -178,6 +178,16 @@
        }
 
        /**
+        * Get the current time in the given format
+        *
+        * @param int $style Constant Output format for timestamp
+        * @return string
+        */
+       public static function now( $style = TS_MW ) {
+               return static::convert( $style, time() );
+       }
+
+       /**
         * Get the timestamp represented by this object in a certain form.
         *
         * Convert the internal timestamp to the specified format and then

-- 
To view, visit https://gerrit.wikimedia.org/r/312167
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c34c0a59bb57652c7a2e959836c8ba400a25f49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to