Skip to content

Commit

Permalink
Merge "Deprecate strtime"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jun 2, 2015
2 parents e5349b9 + 4e01f29 commit f5aa17f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion oslo_utils/timeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,24 @@ def parse_isotime(timestr):
raise ValueError(six.text_type(e))


@removals.remove(
message="use either datetime.datetime.isoformat() "
"or datetime.datetime.strftime() instead",
version="1.6",
removal_version="?",
)
def strtime(at=None, fmt=PERFECT_TIME_FORMAT):
"""Returns formatted utcnow."""
"""Returns formatted utcnow.
.. deprecated:: > 1.5.0
Use :func:`utcnow()`, :func:`datetime.datetime.isoformat`
or :func:`datetime.strftime` instead.
strtime() => utcnow().isoformat()
strtime(fmt=...) => utcnow().strftime(fmt)
strtime(at) => at.isoformat()
strtime(at, fmt) => at.strftime(fmt)
"""
if not at:
at = utcnow()
return at.strftime(fmt)
Expand Down

0 comments on commit f5aa17f

Please sign in to comment.