utils.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:iota.lib.py 作者: iotaledger 项目源码 文件源码
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())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号