def get_current_timestamp():
# type: () -> int
"""
Returns the current timestamp, used to set ``timestamp`` for new
:py:class:`ProposedTransaction` objects.
Split out into a separate function so that it can be mocked during
unit tests.
"""
# Python 3.3 introduced a :py:meth:`datetime.timestamp` method, but
# for compatibility with Python 2, we have to do it the old-fashioned
# way.
# http://stackoverflow.com/q/2775864/
return unix_timestamp(datetime.utcnow().timetuple())
评论列表
文章目录