jenkins-bot submitted this change.
[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.