Update time util docstrings
# See the License for the specific language governing permissions and
# limitations under the License.
#
+"""Time utils for getting and converting datetime objects for the Mycroft
+system. This time is based on the setting in the Mycroft config and may or
+may not match the system locale.
+"""
from datetime import datetime
from dateutil.tz import gettz, tzlocal
@@ -53,7 +57,7 @@ def now_utc():
def now_local(tz=None):
"""Retrieve the current time
- Args:
+ Arguments:
tz (datetime.tzinfo, optional): Timezone, default to user's settings
Returns:
@@ -67,7 +71,7 @@ def now_local(tz=None):
def to_utc(dt):
"""Convert a datetime with timezone info to a UTC datetime
- Args:
+ Arguments:
dt (datetime): A datetime (presumably in some local zone)
Returns:
(datetime): time converted to UTC
@@ -82,7 +86,7 @@ def to_utc(dt):
def to_local(dt):
"""Convert a datetime to the user's local timezone
- Args:
+ Arguments:
dt (datetime): A datetime (if no timezone, defaults to UTC)
Returns:
(datetime): time converted to the local timezone
@@ -97,7 +101,7 @@ def to_local(dt):
def to_system(dt):
"""Convert a datetime to the system's local timezone
- Args:
+ Arguments:
dt (datetime): A datetime (if no timezone, assumed to be UTC)
Returns:
(datetime): time converted to the operation system's timezone
