jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/868788 )
Change subject: [Docs] Highlight WbTime examples
......................................................................
[Docs] Highlight WbTime examples
Bug: T325444
Change-Id: I015390826546c5add7a38a51a4fdbf03e87e99c6
---
M pywikibot/__init__.py
1 file changed, 22 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index db7bdfe..0e70224 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -295,7 +295,18 @@
class WbTime(_WbRepresentation):
- """A Wikibase time representation."""
+ """A Wikibase time representation.
+
+ Make a WbTime object from the current time:
+
+ .. code-block:: python
+
+ current_ts = pywikibot.Timestamp.now()
+ wbtime = pywikibot.WbTime.fromTimestamp(current_ts)
+
+ For converting python datetime objects to WbTime objects, see
+ :class:`pywikibot.Timestamp` and :meth:`fromTimestamp`.
+ """
PRECISION = {'1000000000': 0,
'100000000': 1,
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/868788
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I015390826546c5add7a38a51a4fdbf03e87e99c6
Gerrit-Change-Number: 868788
Gerrit-PatchSet: 3
Gerrit-Owner: RPI2026F1 <sarkaraoyan+rpi2026f1(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: RPI2026F1 <sarkaraoyan+rpi2026f1(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged