파이썬 beem에서 특정 블럭 번호에 대응하는 시간 조회
파이썬 beem에서 특정 블럭 번호에 대응하는 시간을 파이썬 datetime 객체로 가져올 수 있습니다. Blockchain 객체에서 제공하는 block_time() 함수를 이용합니다. 이 함수가 반환하는 datetime 객체의 시간대는 GMT(UTC)입니다. 예제 코드는 아래와 같습니다.
from beem.steem import Steem
from beem.blockchain import Blockchain
import datetime
steem_nodes = ["https://api.steemit.com"]
steem = Steem(node=steem_nodes)
bc = Blockchain(blockchain_instance=steem)
# 조회할 블럭 번호 7500번
blk_num = 7500
# 7500번 블럭의 시간을 datetime 객체로 가져와 변수 blk_dt에 할당
blk_dt = bc.block_time(blk_num)
# 출력
print(blk_dt.strftime("%Y.%m.%d %H:%M:%S"))
2016.03.24 22:25:57
반대로 특정 시간에 대응하는 블럭 번호를 가져올 수도 있는데, 이와 관련된 내용은 이전 포스트를 참고하시기 바랍니다. 아래의 링크입니다.
파이썬 beem에서 특정 시간에 대응하는 블럭 번호 조회
@joviansummer의 스팀 프로젝트
스팀 증인노드를 운영중입니다. @jswit에 증인투표해 주시면 감사하겠습니다.
(https://steemitwallet.com/~witnesses)
jsup 서비스에 큐레이션 보상 분배 기능이 추가되었습니다.
jSTEEM 프로젝트 - 텔레그램 챗봇으로 구현하는 스팀 블럭체인 탐색기
Posted through the AVLE Dapp (https://avle.io)
Hello friend!


I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
please click it!
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)
Upvoted! Thank you for supporting witness @jswit.
@응원해
감사합니다!
안녕하세요.
이 글은 SteemitKorea팀(@jungjunghoon)님께서 저자이신 @joviansummer님을 응원하는 글입니다.
소정의 보팅을 해드렸습니다 ^^ 항상 좋은글 부탁드립니다
SteemitKorea팀에서는 보다 즐거운 steemit 생활을 위해 노력하고 있습니다.
이 글은 다음날 다시 한번 포스팅을 통해 소개 될 예정입니다. 감사합니다!
감사합니다!