jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[Docs] Highlight WbTime examples

Bug: T325444
Change-Id: I015390826546c5add7a38a51a4fdbf03e87e99c6
---
M pywikibot/__init__.py
1 file changed, 22 insertions(+), 1 deletion(-)

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 change 868788. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I015390826546c5add7a38a51a4fdbf03e87e99c6
Gerrit-Change-Number: 868788
Gerrit-PatchSet: 3
Gerrit-Owner: RPI2026F1 <sarkaraoyan+rpi2026f1@gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: RPI2026F1 <sarkaraoyan+rpi2026f1@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged