Bitcoin Forum
May 10, 2024, 11:22:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: ElectrumX JSON-RPC - get timestamp for block  (Read 69 times)
RoxxR (OP)
Full Member
***
Offline Offline

Activity: 208
Merit: 148


View Profile
April 26, 2022, 08:58:59 AM
Merited by hugeblack (3), NeuroticFish (1)
 #1

RPC wizards: How would you get the timestamp of a block (or series of blocks), given the block index(es)?
1715340163
Hero Member
*
Offline Offline

Posts: 1715340163

View Profile Personal Message (Offline)

Ignore
1715340163
Reply with quote  #2

1715340163
Report to moderator
1715340163
Hero Member
*
Offline Offline

Posts: 1715340163

View Profile Personal Message (Offline)

Ignore
1715340163
Reply with quote  #2

1715340163
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715340163
Hero Member
*
Offline Offline

Posts: 1715340163

View Profile Personal Message (Offline)

Ignore
1715340163
Reply with quote  #2

1715340163
Report to moderator
1715340163
Hero Member
*
Offline Offline

Posts: 1715340163

View Profile Personal Message (Offline)

Ignore
1715340163
Reply with quote  #2

1715340163
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 26, 2022, 10:21:06 AM
Merited by hugeblack (4), NeuroticFish (2), ABCbits (1)
 #2

The protocol allows you to call blockchain.block.header(height, cp_height=0) with a block height (index) and get the 80 byte header as bytes. The 4 bytes from 68 to 72 are the block's timestamp in little endian order.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
RoxxR (OP)
Full Member
***
Offline Offline

Activity: 208
Merit: 148


View Profile
April 26, 2022, 08:55:21 PM
 #3

The protocol allows you to call blockchain.block.header(height, cp_height=0) with a block height (index) and get the 80 byte header as bytes. The 4 bytes from 68 to 72 are the block's timestamp in little endian order.

Awesome! Thanks; I'll give this a try
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!